[Insight-users] ITK 4.0 using system build of GDCM

Arunabha Roy asroyus at yahoo.com
Wed Jul 11 11:16:36 EDT 2012


Dear ITK-Users,
                            Apologies for revisiting an issue that has been posted multiple times on this forum. I tried reading all previous responses on the subject before writing this.

1. External GDCM build:

The problem is building ITK using a system/external build of the GDCM library. I am doing this on a Windows (7) 64-bit machine, using the latest versions of CMake (2.8.8), ITK (4.1.0) and GDCM (2.2.0). The error that I obtain is the same LINK error as that has been reported earlier for this configuration: gdcmMSFF.lib not found. Attempts to manually add the location of the library (i.e. adding ..\GDCM-2.2BinariesLocation\bin\Release) to the project that fails to build does not solve the problem. I have tried various suggested solutions (one involving building the INSTALL project), another using some tweaks to the GDCM CMake files (http://review.source.kitware.com/#/c/1712/) but none of these have worked. Some respondents have stated that the problem is specific to their Windows builds and that the same code-base builds correctly on Linux.
2. Reading in DICOM tags:


I reproduce below the code snippet that I am using. (I am omitting the preceding use of itk::GDCMSeriesFileNames, gdcm::Reader etc (taken from the Software Guide) that is used to read in a DICOM series from a specified folder - all that works correctly for me)

                     

        gdcm::Reader greader;
        greader.SetFileName( dicomIO->GetFileName() );
        if ( ! greader.Read() ) 
        {
            std::cout << " GDCM reader read failed \n";
            return false;   // handle error
        }

        gdcm::File *f = new gdcm::File();
        f->SetDataSet ( greader.GetFile().GetDataSet() );

        gdcm::Tag radiopharmInfoSeq(0x0054,0x0016);
        const gdcm::DataElement &de = greader.GetFile().GetDataSet().GetDataElement( radiopharmInfoSeq );
        const gdcm::SequenceOfItems *sqi =de.GetSequenceOfItems();
        std::cout << sqi << std::endl;
        const gdcm::Item &item = sqi->GetItem(1);
        while (sqi)
        {
              //COMMENTED OUT PRSENTLY 
            ;//std::cout << sqi->GetEntryString(0x0018,0x1072) << std::endl;
            //sqi = sqi->GetNextSQItem();
        }

The result of the while loop (when the cvommented lines are uncommented) is that no tags get read, as the SequenceOfItems turns out to be a null sequence / sequence of zero length. I believe this has to do with whether Explicit or Implicit VR format is used in the DICOM data ? Is there a way to read this (using the ITK-supplied version of GDCM if necessary) ?

Any help will be greatly appreciated. Thank you.

-- Arun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120711/e74616ed/attachment.htm>


More information about the Insight-users mailing list