Here's some more specifics about the problem: <br>I start with a large 3D image (sometimes RGB, or 16 bit), >2GB. <br>This image has structures in the foreground that I am trying to segment.<br>I begin by using several ITK filters to do some pre-processing on the image (currently the ones listed previously). I write the preprocessed image out to file.<br>
Now I use a series of executables (I do have source), strung together (pipeline), that work on segmenting the image. <br>After each step(exe) the output is written to disk. Output usually includes an image and a text file. These files are used as input to the next step.<br>
<br>At the end I want to visualize the original image, and the segmentation results (from the final text file). <br>The visual program is not connected to the pipeline. It is a separate application. <br><br>Since I have source - I can modify the pipeline as needed - and plan to. I don't see any need to write out a file between each step (unless I need to see it for debugging).<br>
In the end I see two programs: 1. process 2. visualize. <br>However, the problem still remains in both cases. <br><br>A useful example for me would simply be one that loads part of an image using itkImageFileReader, applies a filter (maybe binarize), and writes out the binarized part using itkImageFileWriter..<br>
Say the image is 512x512, but we just load up the first 1/4 of the image (256x256) to binarize and write out. The output should be 512x512 with 1/4 of it binarized, the rest either blank, or just the original grayscale values. I could then use this principle to apply whatever code I wanted to the image in between the read and write.<br>
<br>Does this make sense?<br>Isaac<br><div class="gmail_quote"><br>On Thu, Jan 28, 2010 at 4:08 PM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Isaac,<br>
<br>
Thanks for letting us know about the specific filters<br>
that you are using in the pipeline.<br>
<br>
The Median filter is streamable,<br>
<br>
While the RecursiveGaussian family of filter is not.<br>
<br>
(that is, the Smooth, and Hessian filters based on the<br>
RecursiveGaussianImageFilter, are not streamable).<br>
<br>
<br>
The visualization part may not be too much of a problem,<br>
once the processing of the appropriate chunk has been<br>
solved.<br>
<br>
<br>
What are you doing with the output of the Hessian and<br>
the Smooth Gaussian ?<br>
<br>
Are you visualizing them directly ?<br>
<br>
Note that even though these filters are not strictly<br>
streamable, they have a support where the influence of<br>
far away pixels decrease exponentially. There for you<br>
could still process the image by chunks and get something<br>
"very similar" to the actual outcome of filtering the full image<br>
and then cropping it.<br>
<br>
However, the pipeline will not help you in this process,<br>
you will have to "manually" calculate the region of the<br>
input image, that comes to be visible in your final rendering,<br>
and then extract that region out of the input image using<br>
the RegionOfInterestImageFilter.<br>
<br>
Then feed that smaller image into your pipeline.<br>
<br>
<br>
Please let us know if you find any problems,<br>
<br>
<br>
Thanks<br>
<br>
<br>
Luis<br>
<br>
<br>
---------------------------------------------------------------------------<br>
<div><div></div><div class="h5">On Thu, Jan 28, 2010 at 4:00 PM, Isaac Abbott <<a href="mailto:isaac.abbott@gmail.com">isaac.abbott@gmail.com</a>> wrote:<br>
> Currently I am using the MedianImageFilter and the<br>
> SmoothingRecursiveGaussianImageFilter or<br>
> HessianRecursiveGaussianImageFilter.<br>
> We also do some other "filtering" using code that is not in the form of an<br>
> itk filter (doesn't use any ITK yet)<br>
><br>
> This same project requires some visualization of this image - our plan was<br>
> to create a 2D projection and create a sliding box that the is used to<br>
> define the region that is rendered using VTK.<br>
> For this task I also need to just grab a portion of the image at one time<br>
> for creating the projection and for creating the volume.<br>
><br>
> Isaac<br>
><br>
><br>
> On Thu, Jan 28, 2010 at 3:48 PM, Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>><br>
> wrote:<br>
>><br>
>> Hi Isaac,<br>
>><br>
>> As you have already noticed, not all filters are<br>
>> streamable.<br>
>><br>
>> However, for those that are, it should be possible<br>
>> to process your image by pieces.<br>
>><br>
>> Brad Lowekamp has recently revamped the streaming<br>
>> pipeline and verified that is possible to pass the entire<br>
>> Visible Human dataset through an ITK pipeline.<br>
>><br>
>><br>
>> What specific ITK filters are you using ?<br>
>><br>
>><br>
>> If you are having problems with the pipeline, we should<br>
>> identify a reproducible minimal example, in case there<br>
>> is anything that needs to be fixed.<br>
>><br>
>><br>
>> Please let us know,<br>
>><br>
>><br>
>> Thanks<br>
>><br>
>><br>
>><br>
>> Luis<br>
>><br>
>><br>
>> -----<br>
>> PS. I'm copying the ITK users-list, since this<br>
>> topics will be of interest to many users.<br>
>><br>
>> --------------------------------------------------------------<br>
>> On Thu, Jan 28, 2010 at 3:43 PM, Isaac Abbott <<a href="mailto:isaac.abbott@gmail.com">isaac.abbott@gmail.com</a>><br>
>> wrote:<br>
>> > Luis,<br>
>> ><br>
>> > I'm trying to process some very large 3D images. I cannot load these<br>
>> > images<br>
>> > using ImageFileReader because I run out of RAM.<br>
>> > I would like to apply various filters to only subregions of this image,<br>
>> > and<br>
>> > write the output to the same output image file.<br>
>> ><br>
>> > This means my input and output images might be something like 10,000 x<br>
>> > 10,000 x 200 voxels, but I only want 1000x1000x100 in memory.<br>
>> > I'd load up a region, do the processing, then save the result to file,<br>
>> > and<br>
>> > iterate, saving the results to the same file each time.<br>
>> ><br>
>> > I have been following the discussion about applying filters to ROIs of<br>
>> > an<br>
>> > itk::Image.<br>
>> > I've also seen some discussion about the usage of buffered region vs<br>
>> > largest<br>
>> > possible region vs requested region.<br>
>> > And, I've looked at the StreamingImageFilter - which only seems to work<br>
>> > for<br>
>> > a limited subset of the filters.<br>
>> ><br>
>> > None of these discussions seem to meet my need. According to the<br>
>> > documentation I should be able to do something with the buffered region,<br>
>> > because this defines only the region of the image that is in memory -<br>
>> > but I<br>
>> > haven't seen this work in practice.<br>
>> ><br>
>> > Thanks for any help you can give,<br>
>> > Isaac (Roysam lab, RPI)<br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>