[vtkusers] Why vtkDICOMFileSorter only find one series

chenjianyyzz chenjianyyzz at 163.com
Wed Mar 1 09:54:56 EST 2017


Hello David, 


greak, thank you very much. further question: in the attached files there are 2 stacks, and now I want to find which DICOM files belongs to stack0, and which belongs stack1, how can I find it?
is there any function that I can get the files list for stack0, just like how I get the file list for somes series?
     vtkStringArray *seriesFilenames = sorter->GetFileNamesForSeries(i);




Best Regards
James






At 2017-03-01 21:45:47, "David Gobbi" <david.gobbi at gmail.com> wrote:

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/ab7cc507/attachment.html>


More information about the vtkusers mailing list