<!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.&nbsp; 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.&nbsp; 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.&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader SetFilePrefix &quot;GR&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader SetDataExtent 0 2000 0 2000 0 1500</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader SetFilePattern &quot;%s%04d.JPG&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader SetDataSpacing 2 2 3</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader SetDataScalarTypeToUnsignedShort</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; streamer SetInput [reader GetOutput]</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; streamer SetNumberOfStreamDivisions 32</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [streamer GetExtentTranslator] SetSplitModeToBlock</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; voi SetInput [streamer GetOutput]</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; voi SetVOI 500 1500 400 1600 100 1400</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; voi SetSampleRate 10 10 10</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer SetInput [voi GetOutput]</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer SetFilePrefix &quot;vol&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer SetFilePattern &quot;%s%04d.jpg&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer SetFileDimensionality 3</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer Write</FONT>
</P>

</BODY>
</HTML>