<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<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 name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
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-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</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=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Syrine,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thank you for your help<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I managed to solve the problem by using NumericSeriesFileNames
class.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>However some issues remain unsolved due to incompatibility between
windows and unix path separators, that forces the executable to be used in the
same file as the the header.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Attached the resulting code<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Many thanks,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ezequiel<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Syrine Sahmim
[mailto:syrine.sahmim@yahoo.fr] <br>
<b>Sent:</b> 23 June 2009 18:55<br>
<b>To:</b> Ezequiel Geremia<br>
<b>Cc:</b> insight-users@itk.org<br>
<b>Subject:</b> Re : [Insight-users] Output dicom series in new directory<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'>this is my code and you must
verify your cmake file<br>
#include "itkImageSeriesReader.h"<br>
#include "itkDICOMImageIO2.h"<br>
#include "itkDICOMSeriesFileNames.h"<br>
#include "itkImageFileWriter.h"<br>
<br>
int main( int argc, char* argv[] )<br>
{<br>
/*<br>
if( argc < 3 )<br>
{<br>
std::cerr << "Usage: " << argv[0]
<< " DicomDirectory outputFileName [seriesName]"
<< std::endl;<br>
return EXIT_FAILURE;<br>
}<br>
*/<br>
<br>
argc = 2;<br>
argv[1] = "dicom";<br>
argv[2] = "dicomMRA.hdr";<br>
<br>
typedef
itk::Image<short,3>
ImageType;<br>
typedef itk::ImageSeriesReader< ImageType
> ReaderType;<br>
<br>
itk::DICOMImageIO2::Pointer dicomIO = itk::DICOMImageIO2::New();<br>
<br>
// Get the DICOM filenames from the directory<br>
itk::DICOMSeriesFileNames::Pointer nameGenerator =
itk::DICOMSeriesFileNames::New();<br>
nameGenerator->SetDirectory( argv[1] );<br>
<br>
<br>
try<br>
{<br>
typedef std::vector<std::string> seriesIdContainer;<br>
const seriesIdContainer & seriesUID =
nameGenerator->GetSeriesUIDs();<br>
<br>
seriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>
seriesIdContainer::const_iterator seriesEnd =
seriesUID.end();<br>
<br>
std::cout << std::endl << "The directory:
" << std::endl;<br>
std::cout << std::endl << argv[1] <<
std::endl << std::endl;<br>
std::cout << "Contains the following DICOM Series:
";<br>
std::cout << std::endl << std::endl;<br>
<br>
while( seriesItr != seriesEnd )<br>
{<br>
std::cout << seriesItr->c_str()
<< std::endl;<br>
seriesItr++;<br>
}<br>
<br>
std::cout << std::endl << std::endl;<br>
std::cout << "Now reading series: " <<
std::endl << std::endl;<br>
<br>
typedef std::vector<std::string> fileNamesContainer;<br>
fileNamesContainer fileNames;<br>
<br>
if( argc < 4 ) // If no optional third argument<br>
{<br>
std::cout << seriesUID.begin()->c_str()
<< std::endl;<br>
fileNames = nameGenerator->GetFileNames();<br>
}<br>
else<br>
{<br>
std::cout << argv[3] << std::endl;<br>
fileNames = nameGenerator->GetFileNames(
argv[3] );<br>
}<br>
std::cout << std::endl << std::endl;<br>
<br>
ReaderType::Pointer reader = ReaderType::New();<br>
reader->SetFileNames( fileNames );<br>
reader->SetImageIO( dicomIO );<br>
<br>
try<br>
{<br>
reader->Update();<br>
}<br>
catch (itk::ExceptionObject &ex)<br>
{<br>
std::cout << ex << std::endl;<br>
return EXIT_FAILURE;<br>
}<br>
<br>
typedef itk::ImageFileWriter< ImageType > WriterType;<br>
WriterType::Pointer writer = WriterType::New();<br>
<br>
std::cout << "Writing the image as "
<< std::endl << std::endl;<br>
std::cout << argv[2] << std::endl <<
std::endl;<br>
<br>
writer->SetFileName( argv[2] );<br>
<br>
writer->SetInput( reader->GetOutput() );<br>
<br>
try<br>
{<br>
writer->Update();<br>
}<br>
catch (itk::ExceptionObject &ex)<br>
{<br>
std::cout << ex;<br>
return EXIT_FAILURE;<br>
}<br>
}<br>
catch (itk::ExceptionObject &ex)<br>
{<br>
std::cout << ex;<br>
return EXIT_FAILURE;<br>
}<br>
<br>
return EXIT_SUCCESS;<br>
<br>
}<br>
<br>
i hope that will help you. tell wether your program goes on or not<br>
<br>
<br>
<br>
<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
<hr size=1 width="100%" align=center>
</span></div>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De
:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
Ezequiel Geremia <t-egerem@microsoft.com><br>
<b>À :</b> Mathieu Malaterre <mathieu.malaterre@gmail.com><br>
<b>Cc :</b> "insight-users@itk.org" <insight-users@itk.org><br>
<b>Envoyé le :</b> Mardi, 23 Juin 2009, 16h18mn 52s<br>
<b>Objet :</b> Re: [Insight-users] Output dicom series in new directory<br>
</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br>
No exception is thrown. The output dicom series are not created in the
requested Directory.<br>
<br>
Moreover Syrine, there is not a matter of reading nrrd format, it is just a
matter of outputting generated files in the right directory.<br>
<br>
If already have had that problem and resolve it you can send me the file so
that I can compare it with mine. It will help me solving that issue.<br>
<br>
Thanks,<br>
<br>
Ezequiel<br>
<br>
-----Original Message-----<br>
From: Mathieu Malaterre [mailto:<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>]
<br>
Sent: 23 June 2009 16:11<br>
To: Ezequiel Geremia<br>
Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
Subject: Re: [Insight-users] Output dicom series in new directory<br>
<br>
On Tue, Jun 23, 2009 at 4:45 PM, Ezequiel Geremia<<a
href="mailto:t-egerem@microsoft.com">t-egerem@microsoft.com</a>> wrote:<br>
> Hi insight-users,<br>
><br>
> I wrote a code inspired from itkSoftwraeGuide to convert nrrd files into
dicom series.<br>
><br>
> When running the executable on windows vista, the latter does not output
the dicom slices in the directory specified through<br>
><br>
> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br>
> NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New();<br>
><br>
> namesGenerator->SetOutputDirectory( outputDirectory );<br>
><br>
> Do you have an idea on how to resolve that issue ?<br>
<br>
I have absolutely no idea. But if you send the output of the<br>
executable, I might help. just print the exception that's thrown<br>
during the call to Update() (or Write()) and send it to the list.<br>
<br>
2cts<br>
<br>
-- <br>
Mathieu<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a
href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><o:p></o:p></span></p>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>