Space v. value calibration in ImageJ2

dataset
metadata
imagej2
calibration
scifio
Tags: #<Tag:0x00007fb87b4833a8> #<Tag:0x00007fb87b482fc0> #<Tag:0x00007fb87b482e80> #<Tag:0x00007fb87b482c50> #<Tag:0x00007fb87b482a20>

#1

Hello all,

I’m writing a format plugin for Scifio to add support for the Scanco ISQ format. This format has both space and pixel value calibration in its metadata. In ImageJ1 terminology the space calibration is the pixel width, height and depth values in the Calibration object. Value calibration is used to scale the pixel values before they’re shown to the user (Calibration.setFunction). How can I achieve the same with the ImageMetadata object in Scifio? Right now I can set the space calibration with the setAxes method, but I don’t know how to do the value calibration. Is this something that will addressed in the the “RichImg” replacement for Dataset objects?

Best regards,
Richard Domander


#2

Hi Richard,

If I understand you correctly, Converters will achieve “Value calibration.” You will just need to implement a Converter that takes the “raw” values and outputs the “value calibrated” values.

For instance, the converter could take an input value and scale it by some constant.

Hope this is helpful,
John

Edit: PS. I can’t speak to whether this will be in “RichImg”


#3

Thanks for your reply @bogovicj, to explain my situation better I took these screenshots:


My problem is mainly that I can’t get calibration info and metadata to display the same way than in ImageJ1 (see picture). An ImagePlus object has a Calibration, which can be used to set the physical voxel sizes and calibration function. The former is displayed in the image info, and on the info bar in the image window (36.86 mm x 36.86 mm). The calibration function affects the pixel values shown to the user in the ImageJ window. These values also affect any statistics computed from the image. An ImagePlus also has a FileInfo which can be used to display Scanco format meta data in the image info window.

I don’t know how to achieve this in ImageJ2 / Scifio. I can use the ImageMetadata.setAxes to set the space calibration, but I don’t know how where the calibration function comes from, or how to get the Scanco metadata to show. I’ve tried to set the axes to have the “1/cm” calibration function, but then the image size info becomes weird. Maybe the solution for now would be to scale the pixel values with a converter function, and forget about calibration info.


#4

Ah! That screenshot helps alot thanks @rimadoma.

The missing metadata in ImageJ2 seems to be a key stopping point here - I’m not sure why Scifio doesn’t behave the same in ImageJ1 and 2. Hopefully others who know more can weigh in.

Good luck!