[vtkusers] Why vtkDICOMFileSorter only find one series

David Gobbi david.gobbi at gmail.com
Wed Mar 1 08:45:47 EST 2017


Hi James,

All of the images in that zip file have the same SeriesInstanceUID.  So
this is, in fact, a single series that contains two stacks. This is fairly
common.

The vtkDICOMReader can be used to find the number of stacks:

  vtkSmartPointer<vtkDICOMReader> reader =
vtkSmartPointer<vtkDICOMReader>::New();
  reader->SetFileNames(sorter->GetFileNamesForSeries(0));
  reader->UpdateInformation();
  vtkStringArray *stacks = reader->GetStackIDs();
  int numberOfStacks = stacks->GetNumberOfValues();

The reader can also be told which stack to read:

  reader->SetDesiredStackID(stacks->GetValue(0));
  reader->Update();

With the "Enhanced MR Image IOD" and the "Enhanced CT Image IOD", it is
even possible for a single _file_ to contain multiple stacks.

 - David







On Wed, Mar 1, 2017 at 3:50 AM, chenjianyyzz <chenjianyyzz at 163.com> wrote:

> Hello David,
>
> I have a set  of images (it includes 2 series), but the vtkDICOMFileSorter
> can only 1 series?
> I don't know what's the problem, will any body help me out?
>
> attached please find the data, and below is the code:
> ========================================================
> vtkSmartPointer<vtkStringArray> filenames = vtkSmartPointer<
> vtkStringArray>::New();
> filenames->InsertNextValue("A_10_0001_0325.dcm");
> filenames->InsertNextValue("A_10_0001_0326.dcm");
> filenames->InsertNextValue("A_10_0001_0327.dcm");
> filenames->InsertNextValue("A_10_0001_0328.dcm");
> filenames->InsertNextValue("A_10_0001_0329.dcm");
> filenames->InsertNextValue("A_10_0001_0330.dcm");
> filenames->InsertNextValue("A_10_0001_0331.dcm");
> filenames->InsertNextValue("A_10_0001_0332.dcm");
> filenames->InsertNextValue("A_10_0001_0333.dcm");
> filenames->InsertNextValue("A_10_0001_0334.dcm");
> filenames->InsertNextValue("A_10_0001_0335.dcm");
> vtkSmartPointer <vtkDICOMFileSorter> sorter = vtkSmartPointer
> <vtkDICOMFileSorter>::New();
> sorter->SetInputFileNames(filenames);
> sorter->Update();
>
> // Get number of series
> int numSeries = sorter->GetNumberOfSeries(); //==> here I expect to get
> 2, but only 1 got
> ========================================================
>
> actually "A_10_0001_0325.dcm" should be seperate into another series, will
> any body help me out?
> thanks in advance
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170301/0f95b85e/attachment.html>


More information about the vtkusers mailing list