<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>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. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>I actually already found a partial solution: <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> nameGenerator->SetUseSeriesDetails(true);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> nameGenerator->SetNumberOfThreads(4);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1050, "-300", gdcm::CompOperators::GDCM_GREATEROREQUAL);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1050, "-800", gdcm::CompOperators::GDCM_LESSOREQUAL);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1051, "1100", gdcm::CompOperators::GDCM_GREATEROREQUAL);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> nameGenerator->GetSeriesHelper()->AddRestriction(0x0028, 0x1051, "1700", gdcm::CompOperators::GDCM_LESSOREQUAL);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>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).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best Wishes<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Xie<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt'>发件人<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-size:10.0pt'> Lambert Zijp [mailto:ljzijp@gmail.com] <br></span><b><span style='font-size:10.0pt'>发送时间<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-size:10.0pt'> 2016</span><span style='font-size:10.0pt'>年<span lang=EN-US>3</span>月<span lang=EN-US>19</span>日<span lang=EN-US> 3:12<br></span><b>收件人<span lang=EN-US>:</span></b><span lang=EN-US> D</span></span><span style='font-size:10.0pt;font-family:"MS Mincho"'>ž</span><span lang=EN-US style='font-size:10.0pt'>enan Zuki</span><span style='font-size:10.0pt;font-family:"MS Mincho"'>ć</span><span lang=EN-US style='font-size:10.0pt'><br></span><b><span style='font-size:10.0pt'>抄送<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-size:10.0pt'> </span><span style='font-size:10.0pt'>谢玮宜<span lang=EN-US>; community@itk.org<br></span><b>主题<span lang=EN-US>:</span></b><span lang=EN-US> Re: [ITK] Read dicom files according to tags<o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-US>Hi Xie,<o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Just out of curiosity, why do you want to read images with a specific level/window pre-set? After all, those are just (recommended) <b>viewer</b> settings. I mean, you can set level/window to whatever you want, but the pixel-data remain the same.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Greetings,<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Lambert<o:p></o:p></span></p></div></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-US>On Fri, Mar 18, 2016 at 7:51 PM, D</span><span style='font-family:"MS Mincho"'>ž</span><span lang=EN-US>enan Zuki</span><span style='font-family:"MS Mincho"'>ć</span><span lang=EN-US> <<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>> wrote:<o:p></o:p></span></p><div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Verdana","sans-serif"'>Hi Xie,<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Verdana","sans-serif"'>maybe you can use ImageIO to <a href="http://itk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType" target="_blank">read image</a> 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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Verdana","sans-serif"'>Regards,<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Verdana","sans-serif"'>Dženan<o:p></o:p></span></p></div></div><div><div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-US>On Fri, Mar 18, 2016 at 1:37 AM, </span>谢玮宜<span lang=EN-US> <<a href="mailto:weiehome@sina.com" target="_blank">weiehome@sina.com</a>> wrote:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><br>Hi,<br><br>I want to read dicom series that only contains tags like window center and<br>window width in a certain range, and I don’t know how to do it using<br>gdcmImage io in itk.<br>I have read some dicom series reader examples but I still didn't figured<br>out. The GDCMSeriesFileNames seems not designed for this case.<br><br><br> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br> NamesGeneratorType::Pointer nameGenerator =<br>NamesGeneratorType::New();<br><br> nameGenerator->SetUseSeriesDetails(true);<br> nameGenerator->AddSeriesRestriction("0008|0021");<br> nameGenerator->AddSeriesRestriction("0018|0024");<br> nameGenerator->AddSeriesRestriction("0020|0011");<br> nameGenerator->AddSeriesRestriction("0018|0050");<br> nameGenerator->AddSeriesRestriction("0028|0010");<br> nameGenerator->AddSeriesRestriction("0028|0011");<br> nameGenerator->SetDirectory(filePath);<br>the given file path contains 3 dicom series with different window center and<br>window width settings ,yet only one is what I am interested in.<br>I know I can read all series first and then read each series to check if its<br>tags meets my requirements. However, it is slow. What I want is a gdcm<br>support for filtering files in its reading.<br><br>Thanks for your answers in advance!<br>BR,xie<br><br><br>_______________________________________________<br>Community mailing list<br><a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a><br><a href="http://public.kitware.com/mailman/listinfo/community" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US><br>_______________________________________________<br>Community mailing list<br><a href="mailto:Community@itk.org">Community@itk.org</a><br><a href="http://public.kitware.com/mailman/listinfo/community" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></div></body></html>