<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Large Volume Data</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2716.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Try using&nbsp; vtkImageClip instead of 
vtkExtractVOI. There was an earlier message that suggested that the latter still 
requires the whole dataset to be loaded wheras the former does not.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=ficmic01@evergreen.edu href="mailto:ficmic01@evergreen.edu">FICKER, 
  MICHAEL</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@public.kitware.com 
  href="mailto:'vtkusers@public.kitware.com'">'vtkusers@public.kitware.com'</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, 06 August, 2002 10:48 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] Large Volume 
  Data</DIV>
  <DIV><BR></DIV>
  <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 
  "GR"</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 
  "%s%04d.JPG"</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 "vol"</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer SetFilePattern 
  "%s%04d.jpg"</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></BLOCKQUOTE></BODY></HTML>