dicom image dimensions

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

dicom image dimensions

Matteo Manca
Hi everyone,
I’m new with imageJ, so I early apologize if my question is too naive.
I’m using imageJ java lib (ij.jar) to read a .dicom file and to make some image processing. First of all, I would be interested to know the dimension of my .dicom file so I run the following code:


      DICOM dcm = new DICOM();
      dcm.open(path);
      System.out.print("\n Number of dimensions: " + dcm.getNDimensions());


as  result I obtain: "Number of dimensions: 2” while if I open the same file using matlab I can see that it is a   3584 x 1966  x   6 dicim file, so I would aspect to get 3 as number of dimension.

How can I get the number of slices (in this case 6)?

Any suggestion about?

Thanks in advance,
Matteo
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: dicom image dimensions

Peter Mc
Hi Matteo;

Probably you are getting the dimensions defined within DICOM header, better load the image as a simple ImagePlus object so you will obtain your the real dimension (3 in your case I guess). If you want to get the number of slices use getNSlices() method.

Regards.
Research engineer
HGGM. Madrid.
Reply | Threaded
Open this post in threaded view
|

Re: dicom image dimensions

ctrueden
In reply to this post by Matteo Manca
Hi Matteo,

> I would be interested to know the dimension of my .dicom file

Another possibility is the Bio-Formats library. See e.g. this macro:

https://github.com/openmicroscopy/bioformats/blob/v5.0.5/components/bio-formats-plugins/utils/macros/basicMetadata.txt

Bio-Formats is included with the Fiji distribution of ImageJ:
http://fiji.sc/Downloads

Regards,
Curtis

On Wed, Sep 17, 2014 at 10:49 AM, Matteo Manca <[hidden email]>
wrote:

> Hi everyone,
> I’m new with imageJ, so I early apologize if my question is too naive.
> I’m using imageJ java lib (ij.jar) to read a .dicom file and to make some
> image processing. First of all, I would be interested to know the dimension
> of my .dicom file so I run the following code:
>
>
>       DICOM dcm = new DICOM();
>       dcm.open(path);
>       System.out.print("\n Number of dimensions: " + dcm.getNDimensions());
>
>
> as  result I obtain: "Number of dimensions: 2” while if I open the same
> file using matlab I can see that it is a   3584 x 1966  x   6 dicim file,
> so I would aspect to get 3 as number of dimension.
>
> How can I get the number of slices (in this case 6)?
>
> Any suggestion about?
>
> Thanks in advance,
> Matteo
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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