Thanks for replying Luis. I found out what was causing the problem in my code. Btw, I had posted my code before in the list. The link is:<br><a href="http://public.kitware.com/pipermail/insight-users/2007-January/020588.html">
http://public.kitware.com/pipermail/insight-users/2007-January/020588.html</a><br>I am trying to read 2D dicom files from a particular directory. These dicom files may not belong to the same study/series. Then I do some processing on the individual files and write them to a directory provided through a Qt GUI.
<br>I have most of this figure out, only a couple of things and I would appreciate if you could help me with that-<br>1). How do I get rid of the new instance of pointer to reader and writer that gets created inside the for loop. Using &#39;Delete()&#39; gives me errors.
<br>2). How do I set the outputdirectory name for the writer. There is a &#39;setoutputdirectory &#39; function for writing the series, but there isn&#39;t one for the regular writer. I am supplying the writer with the file names and want them all to go to a specific directory provided by the user from the GUI. How do I do it?
<br><br>Thanks,<br>Ashish<br><br><div><span class="gmail_quote">On 1/15/07, <b class="gmail_sendername">Luis Ibanez</b> &lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi Ashish,<br><br>You can reuse a reader for reading multiple<br>series from a directory.<br><br>It is however a common mistake to not initilize<br>the reader properly when it is set inside a for<br>loop.<br><br>Please post your code to the list so we can give
<br>you more specific advice.<br><br>Also, please describe your goal more precisely.<br>In particular: are those 2D DICOM files or are<br>they multi-frame DICOM files ?<br><br>Are you trying to read 3D volumes that are stored
<br>as a collection of 2D DICOM files ?, with multiple<br>volumes being stored in the same directory ?<br><br><br>BTW, please make sure that you put the Update()<br>call inside a try/catch block. It is very likely<br>that the reader is throwing an exception telling
<br>you what the problem is, and you may not be seeing<br>this message. You will find many examples of how<br>to use a try/catch block in the ITK Software Guide.<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;Regards,<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Luis<br><br><br>--------------------
<br>Ashish Singh wrote:<br>&gt; Hi,<br>&gt;<br>&gt; I am a newbie in ITK. I am writing a code which involves reading and<br>&gt; writing multiple dicom files from a directory. These dicom files belong<br>&gt; to separate series. I was using a single file reader example within a
<br>&gt; &#39;for&#39; loop. But my code crashes when reader-&gt;update() is called the<br>&gt; second time. Can anyone please tell me what am I doing wrong? And how to<br>&gt; fix the problem?<br>&gt; Is there any other way to read and write multiple dicom files. I already
<br>&gt; tried the imageseriesread and write, even that gives me error when there<br>&gt; is only one dicom file from a particular series in my directory.<br>&gt; What is the best way to do this? Is there any class/function that can do
<br>&gt; this for me? Please help.<br>&gt;<br>&gt; Thanks,<br>&gt; Ashish<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________
<br>&gt; Insight-users mailing list<br>&gt; <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users
</a><br></blockquote></div><br>