Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"java.lang.ArrayIndexOutOfBoundsException: 2" for Positions from file .... an .ome.tiff - specific issue #53

Open
kouichi-c-nakamura opened this issue Mar 2, 2018 · 1 comment

Comments

@kouichi-c-nakamura
Copy link

I have tiled square images (2048*2048 * 4 channels, 16 bit) to be stitched.

Fiji > Stitching > Positions from file worked really well with the following TileConfiguration.txt file.

# Define the number of dimensions we are working on
dim = 2

# Define the image coordinates
000000_000001.jp2; ; (0, 0)
000000_000002.jp2; ; (1648, 0)
000000_000003.jp2; ; (3296, 0)
000000_000004.jp2; ; (4944, 0)
000000_000005.jp2; ; (4944, 1648)
000000_000006.jp2; ; (3296, 1648)
000000_000007.jp2; ; (1648, 1648)
000000_000008.jp2; ; (0, 1648)
000000_000009.jp2; ; (0, 3296)
000000_000010.jp2; ; (1648, 3296)
000000_000011.jp2; ; (3296, 3296)
000000_000012.jp2; ; (4944, 3296)
000000_000013.jp2; ; (4944, 4944)
000000_000014.jp2; ; (3296, 4944)
000000_000015.jp2; ; (1648, 4944)
000000_000016.jp2; ; (0, 4944)

However, these images are having problems (chromatic aberrations), and to correct the problems, a few pixels at the periphery were removed using MATLAB. Now they are 2035*2036 in dimension.

Because they have 4 channels in 16 bit depth, the only format I could use in MATLAB was *.ome.tiff with bfsave().

Although now they are slightly smaller, the relative distance in pixels between images remains unchanged. So I should be able to use the same coordinate as above. The TileConfiguration.txt I prepared is like this:

# Define the number of dimensions we are working on
dim = 2

# Define the image coordinates
000000_000001.ome.tiff; ; (0, 0)
000000_000002.ome.tiff; ; (1648, 0)
000000_000003.ome.tiff; ; (3296, 0)
000000_000004.ome.tiff; ; (4944, 0)
000000_000005.ome.tiff; ; (4944, 1648)
000000_000006.ome.tiff; ; (3296, 1648)
000000_000007.ome.tiff; ; (1648, 1648)
000000_000008.ome.tiff; ; (0, 1648)
000000_000009.ome.tiff; ; (0, 3296)
000000_000010.ome.tiff; ; (1648, 3296)
000000_000011.ome.tiff; ; (3296, 3296)
000000_000012.ome.tiff; ; (4944, 3296)
000000_000013.ome.tiff; ; (4944, 4944)
000000_000014.ome.tiff; ; (3296, 4944)
000000_000015.ome.tiff; ; (1648, 4944)
000000_000016.ome.tiff; ; (0, 4944)

Although running Fiji > Stitching > Positions from file of these corrected images succeeded in loading 16 images, then it resulted in the following JAVA error, related to an illegal array index.

(Fiji Is Just) ImageJ 2.0.0-rc-65/1.51u; Java 1.8.0_66 [64-bit]; Windows 7 6.1; 666MB of 24439MB (2%)
 
java.lang.ArrayIndexOutOfBoundsException: 2
	at mpicbg.stitching.CollectionStitchingImgLib.findOverlappingTiles(CollectionStitchingImgLib.java:223)
	at mpicbg.stitching.CollectionStitchingImgLib.stitchCollection(CollectionStitchingImgLib.java:49)
	at plugin.Stitching_Grid.run(Stitching_Grid.java:539)
	at ij.IJ.runUserPlugIn(IJ.java:221)
	at ij.IJ.runPlugIn(IJ.java:185)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:745)

Without being able to debug runtime, it is very difficult to work out what's causing this error.

Fiji > Stitching > Unknown Position took forever, so I had to stop it in the middle, but at least didn't throw the same error as above.

Other test results.

Test Format Bit depth Dimension Channels Stitching > Positions from file
A .jp2 16 2048*2048 4 Success
B .ome.tiff 16 2035*2036 4 Failure
C .tiff 16 2035*2036 1 Success
D .ome.tiff 16 2048*2048 1 Success
E .ome.tiff 16 2035*2036 1 Success
F .ome.tiff 16 2048*2048 4 Failure
G .ome.tiff 16 2048*2048 2 Failure
H .tiff 16 2048*2048 3 Success

Taken together, maybe I can say the following things.

  • The XY size of image does not matter.
  • It appears to be a multi-channels .ome.tiff specific issue

I'm prepared to send my test images and other data for you to investigate.

@kouichi-c-nakamura
Copy link
Author

I've done a positive control experiment, which says Stitching can work with .ome.tif files.

  1. Fiji > File > Open Samples > T1 Head (2.4 MB 16 bit)
  2. Fiji > Image > Stacks > Tools > Make Substack...
    1. Type 1-20 and click OK
  3. Fiji > File > Save As > OME-TIFF...
    1. Choose a folder test and define the file name 1, and click Save
    2. Tick "Write each Z sectopm to a separate file"
    3. Choose "Uncompressed", untick "Export ROIs", and click OK
  4. Fiji > Plugins > Stitching > Grid/Collection stitching
    1. Type = Unknown position, Order = All files in directory, and click OK
    2. Choose the directory, untick "Confirm files", and click OK
    3. It finished without an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant