33import bdv .cache .SharedQueue ;
44import bdv .util .Affine3DHelpers ;
55import bdv .viewer .Source ;
6+ import ch .epfl .biop .bdv .img .omero .command .OmeroConnectCommand ;
7+ import ch .epfl .biop .bdv .img .omero .command .OmeroDisconnectCommand ;
68import ij .ImagePlus ;
79import ij .measure .Calibration ;
810import mpicbg .spim .data .sequence .VoxelDimensions ;
2527
2628class ImageDataTest < R extends RealType < R > >
2729{
28- @ Test
30+ // NB: This is brittle as it relies on the omero-tim server to be responsive.
31+ // I had time-out issues; thus commenting out this test
32+ // @Test
2933 public void openOmeroBdvXml () throws ExecutionException , InterruptedException
3034 {
3135 // References
3236 // https://github.com/mobie/mobie-io/issues/169
3337 // https://forum.image.sc/t/opening-omero-datasets-in-mobie/117612/22
3438
3539 ImageJ imageJ = new ImageJ ();
36- imageJ .command ().run (ch . epfl . biop . bdv . img . omero . command . OmeroConnectCommand .class , true ,
40+ imageJ .command ().run ( OmeroConnectCommand .class , true ,
3741 "host" , "omero-tim.gerbi-gmb.de" ,
3842 "username" , "read-tim" ,
3943 "password" , "read-tim"
@@ -56,7 +60,7 @@ public void openOmeroBdvXml() throws ExecutionException, InterruptedException
5660 assertEquals ( "Slide_00.vsi [10x_09]-FL FITC" , imageData .getName ( 7 ) );
5761 assertEquals ( 1000 , imageData .getMetadata ( 10 ).maxIntensity () );
5862
59- imageJ .command ().run (ch . epfl . biop . bdv . img . omero . command . OmeroDisconnectCommand .class , true ,
63+ imageJ .command ().run ( OmeroDisconnectCommand .class , true ,
6064 "host" , "omero-tim.gerbi-gmb.de"
6165 ).get ();
6266
@@ -74,7 +78,7 @@ public void openPNG()
7478 assertEquals ( 3 , valuePair .getA ().getRealDouble () );
7579 assertEquals ( 220 , valuePair .getB ().getRealDouble () );
7680 VoxelDimensions voxelDimensions = imageData .getSourcePair ( 0 ).getB ().getVoxelDimensions ();
77- assertNotNull ( voxelDimensions );
81+ assertTrue ( voxelDimensions . unit (). equals ( "pixel" ) || voxelDimensions . unit (). equals ( "px" ) );
7882 System .out .println ("...openPNG: Done!" );
7983 }
8084
@@ -90,7 +94,7 @@ public void openMRC()
9094 ValuePair < R , R > valuePair = computeMinMax ( imageData );
9195 assertEquals ( -1468 , valuePair .getA ().getRealDouble () );
9296 assertEquals ( 9827 , valuePair .getB ().getRealDouble () );
93- assertNotNull ( voxelDimensions );
97+ assertEquals ( "µm" , voxelDimensions . unit () );
9498 System .out .println ("...openMRC: Done!" );
9599 }
96100
@@ -111,6 +115,6 @@ private static < R extends RealType< R > > ValuePair< R, R > computeMinMax( Imag
111115
112116 public static void main ( String [] args ) throws ExecutionException , InterruptedException
113117 {
114- // new ImageDataTest().openOmeroBdvXml ();
118+ new ImageDataTest ().openMRC ();
115119 }
116120}
0 commit comments