[ITK] Read dicom files according to tags

谢玮宜 weiehome at sina.com
Fri Mar 18 01:37:40 EDT 2016


Hi,

I want to read dicom series that only contains tags like window center and
window width in a certain range, and I don’t know how to do it using
gdcmImage io in itk.
I have read some dicom series reader examples but I still didn't figured
out. The GDCMSeriesFileNames seems not designed for this case.


	typedef itk::GDCMSeriesFileNames NamesGeneratorType;
	NamesGeneratorType::Pointer nameGenerator =
NamesGeneratorType::New();

	nameGenerator->SetUseSeriesDetails(true);
	nameGenerator->AddSeriesRestriction("0008|0021");
	nameGenerator->AddSeriesRestriction("0018|0024");
	nameGenerator->AddSeriesRestriction("0020|0011");
	nameGenerator->AddSeriesRestriction("0018|0050");
	nameGenerator->AddSeriesRestriction("0028|0010");
	nameGenerator->AddSeriesRestriction("0028|0011");
	nameGenerator->SetDirectory(filePath);
the given file path contains 3 dicom series with different window center and
window width settings ,yet only one is what I am interested in. 
I know I can read all series first and then read each series to check if its
tags meets my requirements. However, it is slow. What I want is a gdcm
support for filtering files in its reading. 

Thanks for your answers in advance! 
BR,xie 




More information about the Community mailing list