You want to experience the problem yourself? Please download this tiff file and do the following:
- Drag and drop the downloaded file into Fiji (or IJ).
- In Fiji go to ‘Edit - Options - ImageJ2’ and turn on SCIFIO.
- Drag and drop the downloaded file into Fiji (or IJ) again.
Putting the two files next to each other they look like this:
This should convince you that we have a problem.
Now a bit more in depth: how did I create the tiff file in the first place?
I am not sure if this is the best way to do it (certainly it is not very compact), but it is the only way I know at the moment and a few weeks ago it seemed the only way to do it:
final DatasetService datasetService = context.getService( DatasetService.class );
final Dataset dataset = datasetService.create( rai );
final DatasetIOService service = context.getService( DatasetIOService.class );
try {
service.save( dataset, filename );
} catch ( final IOException exc ) {
exc.printStackTrace();
}
Does anybody have an idea what is going on? The problem started occurring somewhere within the last few weeks…
Thanks for your help,
Florian
PS: there is more problems… check out this file: flow.tif
Opened with Fiji without SCIFIO it is a stack with 50 slices. Using SCIFIO it is a single slice!!! My tools are all broken at the moment…
PPS: yet another issue regarding image saving (very different behavior with IJ vs. IJ2)
The following code creates a flattened stack [512,256,50]…
try {
new ImgSaver().saveImg( filename, ImgView.wrap( rai, null ) );
} catch ( ImgIOException | IncompatibleTypeException e ) {
e.printStackTrace();
}
… while the following IJ1 alternative…
final ImagePlus ip = ImageJFunctions.wrap( flow, "flow" );
IJ.save( ip.duplicate(), fileFlow.getAbsolutePath() );
does what I expected both snippets to do and stores a HyperStack [512,256,2,25].