Quantcast

pydicom vs GDCMImageIO vs SimpleITK usage

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

pydicom vs GDCMImageIO vs SimpleITK usage

erol yeniaras
Hello all,

Has anyone tried using pydicom with binary version of Slicer on windows?

PS: I want to read full dicom headers in my python module and either pydicom or somehow to be able to include full ITK functionality (GDCMImageIO) could do that. I tried SimpleITK but it does not seem to work for reading image series.

Best,
Erol

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pydicom vs GDCMImageIO vs SimpleITK usage

lasso

Not the nicest but a very simple solution: run dcmdump (included in the Slicer package) and grep the required fields from the output.

Andras

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of erol yeniaras
Sent: Monday, June 03, 2013 1:49 PM
To: slicer-devel
Subject: [slicer-devel] pydicom vs GDCMImageIO vs SimpleITK usage

 

Hello all,

 

Has anyone tried using pydicom with binary version of Slicer on windows?

 

PS: I want to read full dicom headers in my python module and either pydicom or somehow to be able to include full ITK functionality (GDCMImageIO) could do that. I tried SimpleITK but it does not seem to work for reading image series.

 

Best,

Erol


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pydicom vs GDCMImageIO vs SimpleITK usage

erol yeniaras
Thanks Andras, I guess I will have to build Slicer on this machine for pydicom.
In the meantime, as you suggested, I will use dump=DICOMLib.DICOMCommand('dcmdump', ['path to data']).start()

Erol


On Mon, Jun 3, 2013 at 4:23 PM, Andras Lasso <[hidden email]> wrote:

Not the nicest but a very simple solution: run dcmdump (included in the Slicer package) and grep the required fields from the output.

Andras

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of erol yeniaras
Sent: Monday, June 03, 2013 1:49 PM
To: slicer-devel
Subject: [slicer-devel] pydicom vs GDCMImageIO vs SimpleITK usage

 

Hello all,

 

Has anyone tried using pydicom with binary version of Slicer on windows?

 

PS: I want to read full dicom headers in my python module and either pydicom or somehow to be able to include full ITK functionality (GDCMImageIO) could do that. I tried SimpleITK but it does not seem to work for reading image series.

 

Best,

Erol




--

Erol YENIARAS, Ph.D.
The University of Texas MD Anderson Cancer Center
Department of Imaging Physics - Unit 1902
1881 East Road
Houston, Texas 77054

United States
Phone: (713) 563-6407

Fax: (713) 563-2986
E-mail: [hidden email]


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pydicom vs GDCMImageIO vs SimpleITK usage

Steve Pieper
Hi Erol - 

pydicom is the most elegant way to map the dicom elements to python data types.  I haven't tried installing it on windows slicer but since I believe it is pure python it should be possible to install it if you just get the files in the right directory.  Long term, pydicom is on the list of python packages we would like to bundle with slicer [1].

If you just need to access a few tags from a file, some other alternatives are available in the ctkDICOMDatabase [2] (which is available in slicer as slicer.dicomDatabase).  Some methods to look at are:

* loadHeader, headerKeys, headerValue: with these, you can load the header for a file and query any of the printable tag values (only values that map to strings are available).  This uses the same dcmtk calls internally as are used in dcmdump, so it can avoid the process overhead.

* instanceValue, fileValue: for these you pass in either an instanceUID or file path and a tag and you get back the value from the tag cache.  If the tag was not in the cache it will be loaded from the file and placed in the cache for future use.  So cache misses are expensive, but getting data from the cache is fast.

I'll also note that it is good to use the dicomDatabase for other operations (like studiesForPatient, seriesForStudy, instancesForSeries) where you want to have random access up and down the levels.  This is where the database is more useful than pydicom, which only operates at the single dataset level.

HTH,
-Steve





On Mon, Jun 3, 2013 at 6:04 PM, erol yeniaras <[hidden email]> wrote:
Thanks Andras, I guess I will have to build Slicer on this machine for pydicom.
In the meantime, as you suggested, I will use dump=DICOMLib.DICOMCommand('dcmdump', ['path to data']).start()

Erol


On Mon, Jun 3, 2013 at 4:23 PM, Andras Lasso <[hidden email]> wrote:

Not the nicest but a very simple solution: run dcmdump (included in the Slicer package) and grep the required fields from the output.

Andras

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of erol yeniaras
Sent: Monday, June 03, 2013 1:49 PM
To: slicer-devel
Subject: [slicer-devel] pydicom vs GDCMImageIO vs SimpleITK usage

 

Hello all,

 

Has anyone tried using pydicom with binary version of Slicer on windows?

 

PS: I want to read full dicom headers in my python module and either pydicom or somehow to be able to include full ITK functionality (GDCMImageIO) could do that. I tried SimpleITK but it does not seem to work for reading image series.

 

Best,

Erol




--

Erol YENIARAS, Ph.D.
The University of Texas MD Anderson Cancer Center
Department of Imaging Physics - Unit 1902
1881 East Road
Houston, Texas 77054

United States
Phone: (713) 563-6407

Fax: (713) 563-2986
E-mail: [hidden email]


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pydicom vs GDCMImageIO vs SimpleITK usage

erol yeniaras
Steve,

Thank you very much for this detailed explanation. It helps a lot! I`ll try dicomDatabase immediately.

Best,
Erol


On Mon, Jun 3, 2013 at 6:06 PM, Steve Pieper <[hidden email]> wrote:
Hi Erol - 

pydicom is the most elegant way to map the dicom elements to python data types.  I haven't tried installing it on windows slicer but since I believe it is pure python it should be possible to install it if you just get the files in the right directory.  Long term, pydicom is on the list of python packages we would like to bundle with slicer [1].

If you just need to access a few tags from a file, some other alternatives are available in the ctkDICOMDatabase [2] (which is available in slicer as slicer.dicomDatabase).  Some methods to look at are:

* loadHeader, headerKeys, headerValue: with these, you can load the header for a file and query any of the printable tag values (only values that map to strings are available).  This uses the same dcmtk calls internally as are used in dcmdump, so it can avoid the process overhead.

* instanceValue, fileValue: for these you pass in either an instanceUID or file path and a tag and you get back the value from the tag cache.  If the tag was not in the cache it will be loaded from the file and placed in the cache for future use.  So cache misses are expensive, but getting data from the cache is fast.

I'll also note that it is good to use the dicomDatabase for other operations (like studiesForPatient, seriesForStudy, instancesForSeries) where you want to have random access up and down the levels.  This is where the database is more useful than pydicom, which only operates at the single dataset level.

HTH,
-Steve





On Mon, Jun 3, 2013 at 6:04 PM, erol yeniaras <[hidden email]> wrote:
Thanks Andras, I guess I will have to build Slicer on this machine for pydicom.
In the meantime, as you suggested, I will use dump=DICOMLib.DICOMCommand('dcmdump', ['path to data']).start()

Erol


On Mon, Jun 3, 2013 at 4:23 PM, Andras Lasso <[hidden email]> wrote:

Not the nicest but a very simple solution: run dcmdump (included in the Slicer package) and grep the required fields from the output.

Andras

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of erol yeniaras
Sent: Monday, June 03, 2013 1:49 PM
To: slicer-devel
Subject: [slicer-devel] pydicom vs GDCMImageIO vs SimpleITK usage

 

Hello all,

 

Has anyone tried using pydicom with binary version of Slicer on windows?

 

PS: I want to read full dicom headers in my python module and either pydicom or somehow to be able to include full ITK functionality (GDCMImageIO) could do that. I tried SimpleITK but it does not seem to work for reading image series.

 

Best,

Erol




--

Erol YENIARAS, Ph.D.
The University of Texas MD Anderson Cancer Center
Department of Imaging Physics - Unit 1902
1881 East Road
Houston, Texas 77054

United States
Phone: (713) 563-6407

Fax: (713) 563-2986
E-mail: [hidden email]


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject




--

Erol YENIARAS, Ph.D.
The University of Texas MD Anderson Cancer Center
Department of Imaging Physics - Unit 1902
1881 East Road
Houston, Texas 77054

United States
Phone: (713) 563-6407

Fax: (713) 563-2986
E-mail: [hidden email]


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Loading...