[Insight-users] Memory issue with GDCMImageIO versus DICOMImageIO2
Karthik Krishnan
Karthik.Krishnan at kitware.com
Mon Oct 24 16:33:46 EDT 2005
Robert Maroon wrote:
>--- "Miller, James V (Research)" <millerjv at crd.ge.com>
>wrote:
>
>
>
>>GenerateOutputInformation() is probably going to be
>>protected,
>>and hence not accessible.
>>
>>UpdateOutputInformation() is a public method that
>>should allow
>>you to just get the information about an image.
>>
>>
>
>Karthik and James--thanks for the info, I'll try it
>out.
>
>
>Any ideas on the second question--reading only a
>single frame (or subset of frames) from the DICOM?
>
Yeah.
You can use the GDCMSeriesFileNames class to help you out.
See DicomSeriesReadImageWrite.cxx for an example. The example reads a
dicom series in a directory. It reads the whole thing, but you could
potentially pass just a subset of files in the directory to the reader.
For instance:
FileNamesContainer fileNames = nameGenerator->GetFileNames(
seriesIdentifier );
FileNamesContainer subsetOfFiles;
FileNamesContainer::const_iterator it = fileNames.begin();
for( unsigned int i=0; i< 100; i++)
{
subsetOfFiles.push_back(*it);
std::cout << *it << std::endl;
++it;
}
reader->SetFileNames( subsetOfFiles );
>The
>problem remains that Update() must be avoided as it'll
>crash if the sequence is too large to fit in memory
>all at once.
>
Now if you have a huge multi-frame dicom image, unfortunately GDCM does
not allow frame by frame reading. So if this is a multiframe image you
are talking about, you are screwed. My suggestion is, "Go buy more
memory" :)
>(Unless there is some way to set a frame
>subset beforehand, but this capability doesn't seem to
>be present in GDCMImageIO or ImageIOBase.)
>
>Thanks,
>
>Robert
>
>
>
>
>__________________________________
>Yahoo! Mail - PC Magazine Editors' Choice 2005
>http://mail.yahoo.com
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
>
More information about the Insight-users
mailing list