[ITK] 答复: Read dicom files according to tags

谢玮宜 weiehome at sina.com
Sat Mar 19 03:31:38 EDT 2016


Hi,

 

Exactly, I agree, but in our case, one patient studies contains multiple series that like you said, have many duplicated information. For example, we often encountered one study contains two series that have different windows settings. 

And we only need one of both. So when I write a program to read the folder of study , I want to eliminated out the series with some different window settings. The purpose is to speed up file reading process and cut down memory consumption.

 

I actually already found a partial solution: 

         typedef itk::GDCMSeriesFileNames NamesGeneratorType;

         NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();

         nameGenerator->SetUseSeriesDetails(true);

         nameGenerator->SetNumberOfThreads(4);

         nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1050, "-300", gdcm::CompOperators::GDCM_GREATEROREQUAL);

         nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1050, "-800", gdcm::CompOperators::GDCM_LESSOREQUAL);

         nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1051, "1100", gdcm::CompOperators::GDCM_GREATEROREQUAL);

         nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1051, "1700", gdcm::CompOperators::GDCM_LESSOREQUAL);

However, for some dicoms, window setting has format like 800\1400, then I will have to figure out how to check only first of default window (800 in this case).

 

Best Wishes

Xie

 

发件人: Lambert Zijp [mailto:ljzijp at gmail.com] 
发送时间: 2016年3月19日 3:12
收件人: Dženan Zukić
抄送: 谢玮宜; community at itk.org
主题: Re: [ITK] Read dicom files according to tags

 

Hi Xie,

 

Just out of curiosity, why do you want to read images with a specific level/window pre-set? After all, those are just (recommended) viewer settings. I mean, you can set level/window to whatever you want, but the pixel-data remain the same.

 

Greetings,

Lambert

 

On Fri, Mar 18, 2016 at 7:51 PM, Dženan Zukić <dzenanz at gmail.com> wrote:

Hi Xie,

 

maybe you can use ImageIO to read image <http://itk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType>  information for all the series (just one file from each series should be enough). Then examine the metadata to see whether window conditions are met, and if they are then read the series.

 

Regards,

Dženan

 

On Fri, Mar 18, 2016 at 1:37 AM, 谢玮宜 <weiehome at sina.com> wrote:


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


_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community

 


_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160319/9aa96ebe/attachment.html>


More information about the Community mailing list