[vtkusers] vtkDICOMDirectory and vtkDICOMReader issue with files in the stack.

zarko.milosevic zarko at kg.ac.rs
Thu Jul 21 07:09:48 EDT 2016


I`ve been using vtkDICOMDirectory for finding DICOM series in provided folder
path. vtkDICOMDirectory find all the studies in the path and gives all
series, files of DICOM images, corresponding to the found studies.This is
what i get for some case.
<http://vtk.1045678.n5.nabble.com/file/n5739305/SeriesList.jpg> I select
some of the series, get files corresponding to that series, load it using
vtkDICOMReader and visualize it using vtkImageViewer      // get files for
selected series       vtkStringArray *sortedFiles =
vtkRepresentationReslice::_DICOMDIRECTORY->GetFileNamesForSeries(serieID);         
// read files        vtkSmartPointer reader = vtkSmartPointer::New();       
reader-> SetFileNames(sortedFiles );        reader-> AutoRescaleOff();       
reader-> UpdateInformation();        vtkSmartPointer rescale   =
vtkSmartPointer::New();        rescale-> SetInputConnection(reader
->GetOutputPort());        rescale-> Update();        vtkDICOMMetaData
*metaData = reader ->GetMetaData();        const vtkDICOMValue  &window =
metaData ->GetAttributeValue(DC::WindowWidth),                            &
level = metaData->GetAttributeValue (DC::WindowCenter);       double dWindow
= window. AsDouble();        double dLevel = level. AsDouble();       
vtkSmartPointer lut = vtkSmartPointer::New();        lut->
SetValueRange(0.0, 1.0);            // from black to white        lut->
SetSaturationRange(0.0, 0.0);// no color saturation        lut->
SetRange(dLevel - 0.5 * dWindow , dLevel + 0.5 * dWindow );        lut->
SetRampToLinear();        lut-> Build();        vtkSmartPointer colorMapper
= vtkSmartPointer::New();        colorMapper->SetLookupTable (lut );       
colorMapper->SetInputConnection (rescale ->GetOutputPort());      //
visualize loaded image       
_imageViewer->SetInput(colorMapper->GetOutput());       
_imageViewer->GetRenderer ()->ResetCamera();Now issued are the highilighted
cases on figure above. When i load second highlighted case imageViewer shows
only one slice.I figured out later that issues series have two stacks and
when i load second stack i get in viewer 301 slices.         vtkStringArray
*stackNames = reader ->GetStackIDs();         reader->
SetDesiredStackID(stackNames ->GetValue(1));But, how to find out how many
images is in which of the avalable stacks so my project will be able to
choose automatically which stack will be loaded ?Now real problem gives me
first highlighted series which have 0 stacks and 1 time slot. It have 30
files but when i load it it have only one slice shown.Also, is there some
way to recognize these testing series, with only few files, without counting
files so i can avoid loading it in the project. I can put some threshold
based on the number of files but it would be better if there is some DICOM
tag which can give me info if series is testing one or not.Thank in
advanceZarko



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkDICOMDirectory-and-vtkDICOMReader-issue-with-files-in-the-stack-tp5739305.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160721/3bae8fca/attachment.html>


More information about the vtkusers mailing list