Created
May 7, 2018 14:53
-
-
Save awalter17/bafb746b97dc21ee91e526b7b5853d42 to your computer and use it in GitHub Desktop.
OMERO ROIs with Z=T=C= -1 Behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Main { | |
private Main() { | |
// prevent instantiation of utility class | |
} | |
public static void main(final String... args) throws DSOutOfServiceException, | |
ExecutionException, DSAccessException | |
{ | |
final LoginCredentials cred = new LoginCredentials("root", "omero", | |
"localhost", 4064); | |
final Logger simpleLogger = new SimpleLogger(); | |
final Gateway gateway = new Gateway(simpleLogger); | |
final ExperimenterData user = gateway.connect(cred); | |
final SecurityContext ctx = new SecurityContext(user.getGroupId()); | |
final ROIFacility roiFac = gateway.getFacility(ROIFacility.class); | |
final long roiID = 615; | |
final ROIResult loaded = roiFac.loadROI(ctx, roiID); | |
System.out.println("Number of ROIs loaded: " + loaded.getROIs().size()); | |
for (ROIData roi : loaded.getROIs()) { | |
System.out.println("ROIData id: " + roi.getId()); | |
Iterator<List<ShapeData>> itr = roi.getIterator(); | |
while (itr.hasNext()) { | |
final List<ShapeData> shapes = itr.next(); | |
for (ShapeData shape : shapes) | |
System.out.println("ShapeData id: " + shape.getId()); | |
} | |
System.out.println(); | |
} | |
final Collection<ROIData> saved = roiFac.saveROIs(ctx, 2, loaded.getROIs()); | |
System.out.println("Number of ROIs saved: " + saved.size()); | |
for (ROIData roi : saved) { | |
System.out.println("ROIData id: " + roi.getId()); | |
Iterator<List<ShapeData>> itr = roi.getIterator(); | |
while (itr.hasNext()) { | |
final List<ShapeData> shapes = itr.next(); | |
for (ShapeData shape : shapes) | |
System.out.println("ShapeData id: " + shape.getId()); | |
} | |
System.out.println(); | |
} | |
gateway.disconnect(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment