[Insight-users] Dicom Image : How to access to all the tags

siqi chen siqichensc at gmail.com
Wed Mar 10 09:31:21 EST 2010


Here is the very very old code about GDCM. I can't really recall anything
from this project, you might need to dig into it yourself. But I believe all
the comments and the sample usage may help you a bit. I am very busy
recently and I can't offer you more help.

http://www.rpi.edu/~chens/download/DicomLoad.cpp

Cheers,
Siqi

On Wed, Mar 10, 2010 at 4:51 AM, <edoardo.belletti at alice.it> wrote:

>  Thanks
> Ok I have download gdcm-2.0.12, compile it and set ITK_USE_SYSTEM_GDCM: ON
> than it is correcto to use a CMakeList.txt as this to run my code?:
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
>
> PROJECT(ImageIO)
>
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ENDIF(ITK_FOUND)
>
> OPTION(MITK_USE_SYSTEM_GDCM "Use an outside build of GDCM." OFF)
> MARK_AS_ADVANCED(MITK_USE_SYSTEM_GDCM)
> IF(MITK_USE_SYSTEM_GDCM)
>   FIND_PACKAGE(GDCM)
>   IF(GDCM_FOUND)
>     INCLUDE(${GDCM_USE_FILE})
>     IF( "${GDCM_MAJOR_VERSION}" LESS 2.0 )
>       SET(MITK_GDCM_LIBRARIES gdcm)
>     ELSE( "${GDCM_MAJOR_VERSION}" LESS 2.0 )
>       SET(MITK_GDCM_LIBRARIES gdcmMSFF)
>     ENDIF( "${GDCM_MAJOR_VERSION}" LESS 2.0 )
>   ELSE(GDCM_FOUND)
>     MESSAGE(FATAL_ERROR "Must set GDCM_DIR for MITK_USE_SYSTEM_GDCM.")
>   ENDIF(GDCM_FOUND)
> ELSE(MITK_USE_SYSTEM_GDCM)
>   SET(MITK_GDCM_LIBRARIES itkgdcm)
>   SET(GDCM_INCLUDE_DIR
>     ${ITK_SOURCE_DIR}/Utilities/gdcm/src
>     )
> ENDIF(MITK_USE_SYSTEM_GDCM)
>
>
> ADD_EXECUTABLE(dicom dicom.cxx)
> TARGET_LINK_LIBRARIES(dicom ITKCommon ITKIO)
>
>
> But if it is correct, how can I create a code in gdcm to access all the
> tags of my dicom file?
> and in particular the SQ tag because the tag that I need is:
> "SequenceOfUltrasoundReagions".
>
> thank you very much for your interes
> Edoardo
>
> ================================================================
>
> ================================================================
> -----Messaggio originale-----
> Da: siqi chen [mailto:siqichensc at gmail.com <siqichensc at gmail.com>]
> Inviato: mer 10/03/2010 1.31
> A: edoardo.belletti at alice.it; insight-users
>
> Oggetto: Re: [Insight-users] Dicom Image : How to access to all the tags
>
> Yes. You need to download the latest version of GDCM, compile it (same as
> you do with ITK), in your cmake, you need to link your code to their
> libraries. I believe ITK does not include all libraries of GDCM, at least a
> couple of months ago.
>
> I wrote some code before to access patient tag (patient ID, and some very
> subtle things) from Dicom image I will try to find it and send it to you.
>
> Siqi
>
> On Tue, Mar 9, 2010 at 6:48 PM, <edoardo.belletti at alice.it> wrote:
>
> >  Sorry but I don't undersand. What can I do for access all the tag
> > information?
> > I must install GDCM 2.x and than cofigure it for ITK? How can I do this?
> >
> > Sorry thank you very much
> > Edoardo
> >
> > -----Messaggio originale-----
> > Da: insight-users-bounces at itk.org per conto di siqi chen
> > Inviato: mar 09/03/2010 18.02
> > A: Mathieu Malaterre
> > Cc: ITK_forum
> > Oggetto: Re: [Insight-users] Dicom Image : How to access to all the tags
> >
> >
> > GDCM can access all the tag information, at least in my case.
> >
> > http://www.creatis.insa-lyon.fr/software/public/Gdcm/
> >
> > On Tue, Mar 9, 2010 at 4:58 AM, Mathieu Malaterre <
> > mathieu.malaterre at gmail.com> wrote:
> >
> > > > edoardo.belletti at alice.it wrote:
> > > >>
> > > >> Hi Insight-users,
> > > >> I have a problem: I don't know how can I access to all the tags
> > present
> > > in
> > > >> a dicom image.
> > > >> With the code used in the example of the manual
> > > >> (Examples/IO/DicomImageReadPrintTags.cxx) not all the tags are
> printed
> > > and
> > > >> for accuracy in the output there isn't the tag
> > > >> "SequenceOfUltrasoundReagions" that interest me. But I know that in
> > the
> > > file
> > > >> which I run this tag is present.
> > > >> How can I access to this tag?
> > > >> I hope I was understandable.
> > > >> In particular the piece of code is:
> > > >
> > > On Tue, Mar 9, 2010 at 10:49 AM, Gomez, Alberto <
> alberto.gomez at kcl.ac.uk
> > >
> > > wrote:
> > > > Hi,
> > > >
> > > > I have had the same problem but I think that there is no solution. It
> > > > depends on the manufacturer of the US acquisition system, and whether
> > the
> > > > tags are private or not, and the data encrypted.
> > >
> > > No.
> > >
> > > The DICOM Attribute the OP refers to is a VR:SQ (a public element). As
> > > of now itk::GDCMImageIO does not load VR:SQ DICOM attribute. As
> > > described here:
> > >
> > > http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#_details
> > >
> > > ...
> > > Warning:
> > >    There are several restrictions to this current writer:
> > >
> > >        * Eventhough during the writing process you pass in a DICOM
> > > file as input The output file may not contains ALL DICOM field from
> > > the input file. In particular:
> > >              o The SeQuence DICOM field (SQ).
> > >              o Fields from Private Dictionary
> > >        * Some very long (>0xfff) binary fields are not loaded
> > > (typically 0029|0010), you need to explicitely set the maximum length
> > > of elements to load to be bigger (see Get/SetMaxSizeLoadEntry)
> > > ...
> > >
> > >
> > > You have to use the underlying DICOM library (GDCM 1.x or GDCM 2.x) to
> > > extract that particular -nested- information.
> > >
> > > HTH
> > > --
> > > Mathieu
> > > _____________________________________
> > > Powered by www.kitware.com
> > >
> > > Visit other Kitware open-source projects at
> > > http://www.kitware.com/opensource/opensource.html
> > >
> > > Kitware offers ITK Training Courses, for more information visit:
> > > http://www.kitware.com/products/protraining.html
> > >
> > > Please keep messages on-topic and check the ITK FAQ at:
> > > http://www.itk.org/Wiki/ITK_FAQ
> > >
> > > Follow this link to subscribe/unsubscribe:
> > > http://www.itk.org/mailman/listinfo/insight-users
> > >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100310/0e374ca0/attachment-0001.htm>


More information about the Insight-users mailing list