Hi Tom, Mathieu<div><br>Thank you for the information &amp; pointers! Very helpful.   </div><div><br></div><div>Neal<br><br><div class="gmail_quote">On Thu, Aug 6, 2009 at 1:23 AM, Tom Vercauteren <span dir="ltr">&lt;<a href="mailto:tom.vercauteren@gmail.com" target="_blank">tom.vercauteren@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Neal,<br>
<br>
It is not really what you are asking for but the following IJ<br>
submission might be a good starting point to implement Mathieu&#39;s<br>
proposal:<br>
<a href="http://hdl.handle.net/1926/1505" target="_blank">http://hdl.handle.net/1926/1505</a><br>
<br>
Hope this helps,<br>
Tom<br>
<div><div></div><div><br>
On Thu, Aug 6, 2009 at 10:02, Mathieu<br>
Malaterre&lt;<a href="mailto:mathieu.malaterre@gmail.com" target="_blank">mathieu.malaterre@gmail.com</a>&gt; wrote:<br>
&gt; Hi Neal,<br>
&gt;<br>
&gt;  See my comments interlaced.<br>
&gt;<br>
&gt; On Thu, Aug 6, 2009 at 4:47 AM, Neal Sidhwaney&lt;<a href="mailto:nealsid@gmail.com" target="_blank">nealsid@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hi,<br>
&gt;&gt; I&#39;d like to use ITK to process DICOM images.    I&#39;ve got the toolkit<br>
&gt;&gt; building and played around with the DICOM samples to analyze some image<br>
&gt;&gt; series and it&#39;s very well documented and I had little to no issues getting<br>
&gt;&gt; up and running.<br>
&gt;<br>
&gt; You have no idea how pleasant this sound to me :)<br>
&gt;<br>
&gt;&gt; However, my eventual scenarios involve DICOM images are not stored on disk,<br>
&gt;&gt; but in a custom data store.  For conversational purposes, assume it&#39;s a SQL<br>
&gt;&gt; Database and they are stored as BLOBS(although it&#39;s really not, but the<br>
&gt;&gt; constraints of not being able to use streams or an OS I/O api is still<br>
&gt;&gt; there).  I&#39;d like to avoid having to do unnecessary reads &amp; writes to the<br>
&gt;&gt; filesystem in order to pass ifstreams or filenames to the ITK API.<br>
&gt;&gt; I thought I could accomplish this using a subclass of itkGDCMImageIOthat<br>
&gt;&gt; leveraged the same helper classes that itkGDCMImageIO does.  However, the<br>
&gt;&gt; itkGDCMImageIO class calls into the gdcm library for processing DICOM<br>
&gt;&gt; images.  At least in this case, it does not pass pointers, but filenames<br>
&gt;&gt; around.  I am not sure if subclassing the GDCM library is the way to go<br>
&gt;&gt; here.<br>
&gt;&gt; Can anyone recommend some pointers on what the best way to accomplish this<br>
&gt;&gt; is? If it&#39;s been discussed recently, sorry - I dug around the archives and<br>
&gt;&gt; the code quite a bit before coming to the mailing list.<br>
&gt;<br>
&gt; I think I&#39;ll repeat my previous post, but ITK mechanism is split into<br>
&gt; -basically- two classes: itk::ImageFileReader and the actual<br>
&gt; itk::*ImageIO, in our case this is itk::GDCMImageIO.<br>
&gt; So what you actually want to do is:<br>
&gt;<br>
&gt; 1. Write a itk::ImageStreamReader, which takes as input an already<br>
&gt; opened *stream (a subclass of std::istream in this case), and all it<br>
&gt; does simply pass this open istream to gdcm.<br>
&gt; 2. Make sure you use GDCM 2.x, since it provide a full *stream<br>
&gt; interface, and not only a pseudo FILE* interface as in the old GDCM<br>
&gt; 1.x (currently shipped as default DICOM lib).<br>
&gt; 3. When you configure ITK, use &#39;SYSTEM_GDCM&#39; and point to your<br>
&gt; installed GDCM 2.x installation tree (it will search for a<br>
&gt; GDCMConfig.cmake file).<br>
&gt;<br>
&gt; More info:<br>
&gt; GDCM 2.x:<br>
&gt; * <a href="http://gdcm.sourceforge.net/" target="_blank">http://gdcm.sourceforge.net/</a><br>
&gt;<br>
&gt; Latest release:<br>
&gt; * <a href="http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=GDCM_Release_2.0#GDCM_2.0.12_.282008.2F06.2F12.29" target="_blank">http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=GDCM_Release_2.0#GDCM_2.0.12_.282008.2F06.2F12.29</a><br>


&gt;<br>
&gt; gdcm::Reader::SetStream:<br>
&gt; * <a href="http://gdcm.sourceforge.net/html/classgdcm_1_1Reader.html#2fdbf80e6dedc1f3a127a68d6ab11341" target="_blank">http://gdcm.sourceforge.net/html/classgdcm_1_1Reader.html#2fdbf80e6dedc1f3a127a68d6ab11341</a><br>


&gt;<br>
&gt;<br>
&gt; As a crude hack, simply instanciate a gdcm::ImageReader, pass in the<br>
&gt; subclass of istream via its SetStream() interface, and check that you<br>
&gt; can at least read from your memory stream.<br>
&gt;<br>
&gt; For question on gdcm 2.x, I&#39;d suggest you use the GDCM 2.x ML:<br>
&gt; * <a href="http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=General_questions#Where_are_the_GDCM_mailing_lists_.3F" target="_blank">http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=General_questions#Where_are_the_GDCM_mailing_lists_.3F</a><br>


&gt;<br>
&gt; Good luck,<br>
&gt; --<br>
&gt; Mathieu<br>
&gt; <a href="http://mathieumalaterre.com" target="_blank">http://mathieumalaterre.com</a><br>
</div></div>&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
</blockquote></div><br></div>