Login  Register

Re: Non-Uniform X/Y/Z Units & Patch

Posted by Rasband, Wayne (NIH/NIMH) [E] on Jun 30, 2014; 4:51pm
URL: http://imagej.273.s1.nabble.com/Non-Uniform-X-Y-Z-Units-Patch-tp5008492p5008498.html

On Jun 30, 2014, at 11:04 AM, Alan Brooks wrote:

> My company's systems often acquire image data using a linear
> one-dimensional detector, building up an image over time by scanning. The
> raw data files that come from this process naturally have time as one axis
> and pixel as the other axis. In our raw file reader for ImageJ, I have
> found it useful to preserve these units when reading the raw data by using
> the setX/YUnits() methods in Calibration. This allows our teams to analyze
> the raw time axis for sampling and/or noise artifacts and the raw pixel
> axis for any problems related to individual detectors.
>
> A problem with the current ImageJ handling of non-uniform x, y, and z units
> is that even though the units are set, many of the supporting functions
> just use getUnit() which returns getXUnit() even when getY/ZUnit() might
> differ. For example, the Image->Show Info function display the x-units for
> all dimensions when displaying XResolution and YResolution.
>
> Is there interest in fixing this?

The latest ImageJ daily build (1.49d4) displays non-uniform x and y units in image subtitles. The image subtitle is the text in image windows displayed above the image and below the title bar. As an example, the following JavaScript creates a stack with this subtitle:

    "1/256; 25.6 xunit x 51.2 yunit (256x256); 8-bit; 16MB"

The next daily build (1.49d5) will add support for non-uniform units to the Image>Show Info command.

-wayne

  imp = IJ.createImage("Untitled", "8-bit black", 256, 256, 256);
  cal = imp.getCalibration();
  cal.pixelWidth = 0.1;
  cal.pixelHeight = 0.2;
  cal.pixelDepth = 0.3;
  cal.setXUnit("xunit");
  cal.setYUnit("yunit");
  cal.setZUnit("zunit");
  imp.show();
  win = imp.getWindow();
  print(win.createSubtitle());


> I developed a start at some patches that improve the non-uniform handling
> and submitted them to the imagej-dev mailing list last week (
> http://imagej.net/pipermail/imagej-devel/2014-June/002140.html), but didn't
> hear back as of yet.
>
> Perhaps there is a better way to submit ImageJ1 patches and report bugs? Or
> maybe it is better to have a discussion first before sending out a patch.
> Although I have been developing plugins and using ImageJ for years, this is
> my first attempt to engage with the community. I admit I am confused about
> the proper path for that, perhaps because much of the community's work
> seems to be focused on ImageJ2 development at the moment.
>
> Cheers,
> Alan
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html