[Insight-users] DICOM series private tag

Alberto Bert bert at isiosf.isi.it
Fri Feb 23 16:52:23 EST 2007


Hi all, thanks Mathieu,

I have actually activated the private tags, atleast I think so. Below
you'll find my code.  

If I use "0054|1300" as series restriction, then the slices are grouped
correctly by time frame (series), but the frames are not sorted correctly,
namely the one corresponding to time=20000ms is after the one with
time=100000ms, due to the string sorting of the GDCMSeriesFileNames, I
bileave. If I use "0009|10d8" instead, all the images gets in the same
series. If I try to print out (using a variant of
DicomImageReadPrintTags.cxx) the "0009|10d8" value, I get:

Frame number (0009|10d8)  is: AQAAAA==

While if I try to see its value with DCMTK (dcmdump) then I get the right
values written as:

(0009,10d8) ?? 01\00\00\00

So, that's why I though it could be a format issue.

I've found about this dicom tag in an email to this list, by Kris, but he
hasn't explained how to use it or print it.

http://public.kitware.com/pipermail/insight-users/2006-October/019746.html

Sorry for not have being clear in the previous email, and thanks again 
for your time.

Alberto


struct DCMSeriesType
{
    std::string ID;
    std::vector< std::string > fileNames;
};

std::vector< DCMSeriesType > getDCMSerieses( const std::string & 
inputDirectory, const std::string & seriesRestriction = "" )
{
    typedef itk::GDCMSeriesFileNames NamesGeneratorType;
    typedef std::vector< std::string > SeriesIdContainer;

    NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
    nameGenerator->SetUseSeriesDetails( true );
    nameGenerator->SetLoadPrivateTags( true );
    nameGenerator->SetLoadSequences ( true );
//     nameGenerator->AddSeriesRestriction( "0008|0021" );
    // 	nameGenerator->AddSeriesRestriction( "0054|1300" );
    nameGenerator->AddSeriesRestriction( seriesRestriction.c_str() );
    nameGenerator->SetDirectory( inputDirectory );

    std::vector< DCMSeriesType > serieses;
    try
    {
        const SeriesIdContainer & seriesUID = 
nameGenerator->GetSeriesUIDs();

        SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();
        SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();

        while ( seriesItr != seriesEnd )
        {
            DCMSeriesType series;

            std::string seriesIdentifier = seriesItr->c_str();

            series.ID = seriesIdentifier;
            series.fileNames = nameGenerator->GetFileNames( 
seriesIdentifier );

            serieses.push_back( series );

            seriesItr++;
        }
    }
    catch ( itk::ExceptionObject & err )
    { std::cerr << err << std::endl; std::exit( EXIT_FAILURE ); }

    return serieses;
}



More information about the Insight-users mailing list