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 'Delete()' gives me errors.
<br>2). How do I set the outputdirectory name for the writer. There is a 'setoutputdirectory ' function for writing the series, but there isn'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> <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>> 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> Regards,<br><br><br> Luis<br><br><br>--------------------
<br>Ashish Singh wrote:<br>> Hi,<br>><br>> I am a newbie in ITK. I am writing a code which involves reading and<br>> writing multiple dicom files from a directory. These dicom files belong<br>> to separate series. I was using a single file reader example within a
<br>> 'for' loop. But my code crashes when reader->update() is called the<br>> second time. Can anyone please tell me what am I doing wrong? And how to<br>> fix the problem?<br>> Is there any other way to read and write multiple dicom files. I already
<br>> tried the imageseriesread and write, even that gives me error when there<br>> is only one dicom file from a particular series in my directory.<br>> What is the best way to do this? Is there any class/function that can do
<br>> this for me? Please help.<br>><br>> Thanks,<br>> Ashish<br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________
<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users
</a><br></blockquote></div><br>