Ticket #1405 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

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


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 6 years ago by bdezonia

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

comment:2 Changed 6 years ago by bdezonia

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

comment:3 Changed 6 years ago 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 6 years ago 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 6 years ago 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 6 years ago by bdezonia


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 6 years ago 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 6 years ago by bdezonia (previous) (diff)
Note: See TracTickets for help on using tickets.