I have a 4D dicom series in a folder (which could contain multiple of those) for which
(0020,0100) TemporalPositionIdentifier contains the identifier of the time point. I want to convert this to a 4D (or a series of 3D images), so I read the data using
using NamesGeneratorType = itk::GDCMSeriesFileNames; NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New(); nameGenerator->SetUseSeriesDetails( true ); // Splitting on TemporalPositionIdentifier, could also use TriggerTime // (0020,0100) TemporalPositionIdentifier nameGenerator->AddSeriesRestriction("0020|0100"); nameGenerator->SetDirectory( argv );
Then I get in
nameGenerator->GetSeriesUIDs(); the SeriesUIDs for this series, which are basically the original SeriesInstanceUID + the number in the trigger time (Or some other index?). Now I wish to write these volumes to a filename of the format
SeriesInstanceUID-<curr volume>-<num timepoints>.nrrd. In other words: how do I obtain the original SeriesInstanceUID without parsing through the directory again? Is the appended number the “TemporalPositionIdentifier” (or whatever tag I use?) so I can strip it of the current
SeriesInstanceUID and would this behavior be robust?