Hi Tom, Mathieu<div><br>Thank you for the information & 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"><<a href="mailto:tom.vercauteren@gmail.com" target="_blank">tom.vercauteren@gmail.com</a>></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'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<<a href="mailto:mathieu.malaterre@gmail.com" target="_blank">mathieu.malaterre@gmail.com</a>> wrote:<br>
> Hi Neal,<br>
><br>
> See my comments interlaced.<br>
><br>
> On Thu, Aug 6, 2009 at 4:47 AM, Neal Sidhwaney<<a href="mailto:nealsid@gmail.com" target="_blank">nealsid@gmail.com</a>> wrote:<br>
>> Hi,<br>
>> I'd like to use ITK to process DICOM images. I've got the toolkit<br>
>> building and played around with the DICOM samples to analyze some image<br>
>> series and it's very well documented and I had little to no issues getting<br>
>> up and running.<br>
><br>
> You have no idea how pleasant this sound to me :)<br>
><br>
>> However, my eventual scenarios involve DICOM images are not stored on disk,<br>
>> but in a custom data store. For conversational purposes, assume it's a SQL<br>
>> Database and they are stored as BLOBS(although it's really not, but the<br>
>> constraints of not being able to use streams or an OS I/O api is still<br>
>> there). I'd like to avoid having to do unnecessary reads & writes to the<br>
>> filesystem in order to pass ifstreams or filenames to the ITK API.<br>
>> I thought I could accomplish this using a subclass of itkGDCMImageIOthat<br>
>> leveraged the same helper classes that itkGDCMImageIO does. However, the<br>
>> itkGDCMImageIO class calls into the gdcm library for processing DICOM<br>
>> images. At least in this case, it does not pass pointers, but filenames<br>
>> around. I am not sure if subclassing the GDCM library is the way to go<br>
>> here.<br>
>> Can anyone recommend some pointers on what the best way to accomplish this<br>
>> is? If it's been discussed recently, sorry - I dug around the archives and<br>
>> the code quite a bit before coming to the mailing list.<br>
><br>
> I think I'll repeat my previous post, but ITK mechanism is split into<br>
> -basically- two classes: itk::ImageFileReader and the actual<br>
> itk::*ImageIO, in our case this is itk::GDCMImageIO.<br>
> So what you actually want to do is:<br>
><br>
> 1. Write a itk::ImageStreamReader, which takes as input an already<br>
> opened *stream (a subclass of std::istream in this case), and all it<br>
> does simply pass this open istream to gdcm.<br>
> 2. Make sure you use GDCM 2.x, since it provide a full *stream<br>
> interface, and not only a pseudo FILE* interface as in the old GDCM<br>
> 1.x (currently shipped as default DICOM lib).<br>
> 3. When you configure ITK, use 'SYSTEM_GDCM' and point to your<br>
> installed GDCM 2.x installation tree (it will search for a<br>
> GDCMConfig.cmake file).<br>
><br>
> More info:<br>
> GDCM 2.x:<br>
> * <a href="http://gdcm.sourceforge.net/" target="_blank">http://gdcm.sourceforge.net/</a><br>
><br>
> Latest release:<br>
> * <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>
><br>
> gdcm::Reader::SetStream:<br>
> * <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>
><br>
><br>
> As a crude hack, simply instanciate a gdcm::ImageReader, pass in the<br>
> subclass of istream via its SetStream() interface, and check that you<br>
> can at least read from your memory stream.<br>
><br>
> For question on gdcm 2.x, I'd suggest you use the GDCM 2.x ML:<br>
> * <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>
><br>
> Good luck,<br>
> --<br>
> Mathieu<br>
> <a href="http://mathieumalaterre.com" target="_blank">http://mathieumalaterre.com</a><br>
</div></div>> _____________________________________<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><br>
><br>
</blockquote></div><br></div>