NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1405 (closed defect: fixed)

Opened 2012-08-15T03:07:36-05:00

Last modified 2013-03-19T15:00:44-05:00

Newly created image Properties for pixel width and height is NaN

Reported by: landinig Owned by: curtis
Priority: major Milestone: imagej2-b7-ndim-data
Component: Other Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1563

Description

Create a new greyscale image and save it.
When reloaded, it has Pixel Width and Pixel Heigh sizes of NaN. Voxel Depth, however is set to 1.0

I think all these should be set to 1 (with unit as "pixel" as it is currently) by default. Note that the coordinates in the status bar shows pixel units so it makes no sense to set those to NaN.

There are some plugins and macros that check whether pixels are squared by looking at these values, and IJ2 will stop the show if they are set to NaN.

Change History

comment:1 Changed 2012-12-06T12:03:39-06:00 by bdezonia

  • Blocking 1563 added
  • Milestone set to imagej-2.0.0-beta7

comment:2 Changed 2012-12-06T12:03:59-06:00 by bdezonia

  • Owner set to curtis
  • Status changed from new to assigned

comment:3 Changed 2013-03-19T12:22:12-05:00 by bdezonia

It seems to me that Imglib could default calibration for space and time axes to 1.0 and for other axes to NaN. The changes are likely localized to ImgPlus. If this is desired I can go ahead and just do it.

Note: these needs can inform the axes/units/calibration changes slated for our soon to happen Imglib meeting.

comment:4 Changed 2013-03-19T12:45:36-05:00 by bdezonia

I just retested and see I did not read carefully. Newly created images have the correct calibration of 1's. But saving a new image to disk and reading it back shows NaN values. So perhaps the calibration is not written to disk correctly.

My other comment on general approach is still valid. Right now ImgPlus defaults all unspecified cal values to 1.

comment:5 Changed 2013-03-19T12:47:21-05:00 by curtis

I think setting only the spatial calibrations to 1.0 by default is fine, although how/where this is done will be greatly affected by the upcoming ImgLib2 hackathon that sorts out the related ImgPlus issues. So there is no rush on this ticket till then.

comment:6 Changed 2013-03-19T12:55:29-05:00 by bdezonia

Okay.

Note that the current setting of NaN's is likely happening in ImgOpener::getCalibration(). There unspecified cals are set to NaN for X, Y, Z, and T.

comment:7 Changed 2013-03-19T15:00:44-05:00 by bdezonia

  • Status changed from assigned to closed
  • Resolution set to fixed

Thanks to hinerm physical pixel sizes are now saved to disk. See imglib merge commit  imglib:acb41ac1f6a089f55a1068c2812237f73c44f0d3.

I will close this specific issue as fixed. I have opened another ticket (#1708) capturing the remaining issues mentioned above.

Last edited 2013-04-01T13:52:40-05:00 by bdezonia