<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>Large Volume Data </TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>My data set consists of 1500 jpeg images of 2000x2000 pixels each. I do not intend to visualize such a large volume but I was trying to make VTK extract and resample my Volume of Interest (VOI) and then dump this smaller volume (aprox 150x150x150) out into a new set of jpegs.</FONT></P>
<P><FONT SIZE=2>I have had luck manipulating and visualizing smaller volumes but have been unable to use such a large data set. I have tried various forms of vtkImageDataStreamer and vtkMemoryLimitImageDataStreamer.</FONT></P>
<P><FONT SIZE=2>I have been trying varios forms of the following script. If I only procecss ~350 images it runs fine, but if I try the entire stack VTK crashes.</FONT></P>
<P><FONT SIZE=2>Time is not a concern, the script can run as long as it takes.</FONT>
<BR><FONT SIZE=2>Any ideas on how to work with datasets this large?</FONT>
</P>
<BR>
<P><FONT SIZE=2># read a stack of images starting at GR0000.JPG</FONT>
<BR><FONT SIZE=2>vtkJPEGReader reader</FONT>
<BR><FONT SIZE=2> reader SetFilePrefix "GR"</FONT>
<BR><FONT SIZE=2> reader SetDataExtent 0 2000 0 2000 0 1500</FONT>
<BR><FONT SIZE=2> reader SetFilePattern "%s%04d.JPG"</FONT>
<BR><FONT SIZE=2> reader SetDataSpacing 2 2 3</FONT>
<BR><FONT SIZE=2> reader SetDataScalarTypeToUnsignedShort</FONT>
<BR><FONT SIZE=2> reader GlobalReleaseDataFlagOn</FONT>
</P>
<P><FONT SIZE=2>#Stream the data to comsume less memory</FONT>
<BR><FONT SIZE=2>vtkImageDataStreamer streamer</FONT>
<BR><FONT SIZE=2> streamer SetInput [reader GetOutput]</FONT>
<BR><FONT SIZE=2> streamer SetNumberOfStreamDivisions 32</FONT>
<BR><FONT SIZE=2> [streamer GetExtentTranslator] SetSplitModeToBlock</FONT>
<BR><FONT SIZE=2> streamer UpdateWholeExtent</FONT>
</P>
<P><FONT SIZE=2># Extract and resample a sub volume from the source</FONT>
<BR><FONT SIZE=2>vtkExtractVOI voi</FONT>
<BR><FONT SIZE=2> voi SetInput [streamer GetOutput]</FONT>
<BR><FONT SIZE=2> voi SetVOI 500 1500 400 1600 100 1400</FONT>
<BR><FONT SIZE=2> voi SetSampleRate 10 10 10</FONT>
<BR><FONT SIZE=2> [voi GetOutput] SetScalarTypeToUnsignedChar</FONT>
</P>
<P><FONT SIZE=2># write out the new smaller volume</FONT>
<BR><FONT SIZE=2>vtkJPEGWriter writer</FONT>
<BR><FONT SIZE=2> writer SetInput [voi GetOutput]</FONT>
<BR><FONT SIZE=2> writer SetFilePrefix "vol"</FONT>
<BR><FONT SIZE=2> writer SetFilePattern "%s%04d.jpg"</FONT>
<BR><FONT SIZE=2> writer SetFileDimensionality 3</FONT>
<BR><FONT SIZE=2> writer Write</FONT>
</P>
</BODY>
</HTML>