[Insight-developers] Trying to minimize the memory needed by itkImageFileReader
Luis Ibanez
luis.ibanez at kitware.com
Sun Apr 10 18:45:47 EDT 2011
Hi Roger,
It this different from what this patch was fixing ?:
http://review.source.kitware.com/#change,1248
Please let us know,
Thanks
Luis
------------------------------------------
On Tue, Apr 5, 2011 at 3:32 AM, Roger Bramon Feixas
<rogerbramon at gmail.com> wrote:
> Hi,
> I'm trying to minimize the memory needed at the same time to read a DICOM
> file using itkImageFileReader. Basically, the problem is related with the
> pixel type chosen. I always use "signed short" because I actually work with
> CT and MR but sometimes GDCMImageIO chooses another pixel type and a
> conversion has to be done. It means that when GDCMImageIO is reading, 3
> buffers are allocated:
> - Buffer allocated by this->AllocateOutputs(); in
> ImageFileReader::GenerateData() (line 370 of itkImageFileReader.txx)
> - Buffer allocated by loadBuffer = new char[ sizeOfActualIORegion ]; in
> ImageFileReader::GenerateData() (line 414 of itkImageFileReader.txx)
> - Buffer allocated by reader.Read() in GDCMImageIO::Read of
> itkGDCMImageIO.cxx
> but not all of them are used at the same time. I mean, the memory needed to
> the outputs is allocated at the top of ImageFileReader::GenerateData()
> when this->AllocateOutputs() is called. However, if a conversion has to be
> done, this buffer is used after reading since the buffer used
> is loadBuffer.
> Could be possible to allocate the output memory after the reading (if a
> conversion is needed)? It would allow us to have 2 buffers instead of 3 at
> the same time and it would be great to minimize memory problems reading huge
> multiframes DICOM files which are really common.
> I hope you understand my problem.
> Thanks,
> Roger
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>
More information about the Insight-developers
mailing list