automatically load DICOM stack from folder

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

automatically load DICOM stack from folder

Tony Shepherd
Hi,
I would like my plugin to open a DICOM image into a stack, just like from the menu "file .. import sequence.." when the folder is known, where all the files (slices) are.
The code would look something like:
 
ImagePlus thisDicom = IJ.load("path-to-folder", "DICOM")
or
ImagePlus thisDicom = IJ.loadDicom("path-to-folder")
 
Can I do this (even if it means downloading a class library and using 'import newLibrary.*;' at the head of the plugin) ?    
Reply | Threaded
Open this post in threaded view
|

Re: automatically load DICOM stack from folder

ctrueden
Hi Tony,

I would like my plugin to open a DICOM image into a stack, just like from
> the menu "file .. import sequence.." when the folder is known, where all the
> files (slices) are.
>

If your DICOM files are numbered, you can do this using the Bio-Formats
Importer plugin API. Try something like:

import loci.plugins.BF;
import loci.plugins.in.ImporterOptions;
...
ImporterOptions options = new ImporterOptions();
options.setGroupFiles(true);
options.setId(oneOfTheDicomFiles);
ImagePlus thisDicom = BF.openImagePlus(options)[0];

The "setGroupFiles(true)" command instructs Bio-Formats to attempt to group
files in the same folder based on numbering.

You will need loci_tools.jar in your classpath for this to compile.

HTH,
Curtis

On Tue, Mar 22, 2011 at 4:39 AM, Tony Shepherd
<[hidden email]>wrote:

> Hi,
> I would like my plugin to open a DICOM image into a stack, just like from
> the menu "file .. import sequence.." when the folder is known, where all the
> files (slices) are.
> The code would look something like:
>
> ImagePlus thisDicom = IJ.load("path-to-folder", "DICOM")
> or
> ImagePlus thisDicom = IJ.loadDicom("path-to-folder")
>
> Can I do this (even if it means downloading a class library and using
> 'import newLibrary.*;' at the head of the plugin) ?
>
Reply | Threaded
Open this post in threaded view
|

Re: automatically load DICOM stack from folder

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Tony Shepherd
On Mar 22, 2011, at 5:39 AM, Tony Shepherd wrote:

> Hi,
> I would like my plugin to open a DICOM image into a stack, just like from the menu "file .. import sequence.." when the folder is known, where all the files (slices) are.
> The code would look something like:
>
> ImagePlus thisDicom = IJ.load("path-to-folder", "DICOM")
> or
> ImagePlus thisDicom = IJ.loadDicom("path-to-folder")
>
> Can I do this (even if it means downloading a class library and using 'import newLibrary.*;' at the head of the plugin) ?

You can use

   ImagePlus imp = FolderOpener.open("path-to-folder");

if you upgrade to the 1.45e daily build by using the Help>Update ImageJ command and selecting "daily build" from the drop down menu.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: automatically load DICOM stack from folder

Thomson Neil (EAST KENT HOSPITALS UNIVERSITY NHS FOUNDATION
              TRUST)
In reply to this post by Tony Shepherd
Have you tried the Dicom Import/Export plugin (http://www.iftm.de/telemedizin/dcmimex.htm)? It supports multiple-slice import from a normal folder as well as DICOMDIR format.


Neil Thomson,
Nuclear Medicine Physics Section,
Medical Physics,
Kent and Canterbury Hospital,
UK. CT1 3NG
+44 (0) 1227 766877
________________________________________
From: ImageJ Interest Group [[hidden email]] On Behalf Of Tony Shepherd [[hidden email]]
Sent: 22 March 2011 09:39
To: [hidden email]
Subject: automatically load DICOM stack from folder

Hi,
I would like my plugin to open a DICOM image into a stack, just like from the menu "file .. import sequence.." when the folder is known, where all the files (slices) are.
The code would look something like:

ImagePlus thisDicom = IJ.load("path-to-folder", "DICOM")
or
ImagePlus thisDicom = IJ.loadDicom("path-to-folder")

Can I do this (even if it means downloading a class library and using 'import newLibrary.*;' at the head of the plugin) ?

********************************************************************************************************************

This message may contain confidential information. If you are not the intended recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents:
to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSi recipients
NHSmail provides an email address for your career in the NHS and can be accessed anywhere
For more information and to find out how you can switch, visit www.connectingforhealth.nhs.uk/nhsmail

********************************************************************************************************************