Slicer.java bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Slicer.java bug

Jonas Binding-2
Dear List,

I think there is a bug in Slicer.java (e.g.
http://rsb.info.nih.gov/ij/developer/source/ij/plugin/Slicer.java.html )
concerning spatial Calibration data when Slicing from "Left". When
slicing from "Top", Pixel Height and Voxel Depth are correctly
exchanged. However, when Slicing from "Left", ImageJ (tested with
version 1.40g and 1.41g) actually  takes vertical lines and turns them
into horizontal ones, i.e. what used to be depth becomes height, what
used to be height becomes width and what used to be width becomes depth.
However, the calibration data is not updated accordingly: only width and
depth are swapped, leading to incorrect values:

       } else if (vertical) {
           cal.pixelWidth = origCal.pixelDepth/zSpacing;
           cal.pixelHeight = origCal.pixelHeight;
           cal.pixelDepth = origCal.pixelWidth*outputZSpacing;;


In my eyes, the correct code in the function reslice(ImagePlus imp) would be

       } else if (vertical) {
           cal.pixelWidth = origCal.pixelHeight;
           cal.pixelHeight = origCal.pixelDepth/zSpacing;
           cal.pixelDepth = origCal.pixelWidth*outputZSpacing;;

I probably should also mention that I always use the "Avoid
Interpolation" option, but I don't think that makes a difference for
this bug.


Greetings
Jonas Binding

--
Jonas Binding
Physik-Diplomand
Abteilung Biomedizinische Optik
Max-Planck-Institut für medizinische Forschung
Jahnstr. 29
69120 Heidelberg

Tel.: +49 6221/486-272
Labor: +49 6221/486-641
Fax: +49 6221/486-325