<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1481649367845_2527" dir="ltr">I have a pipeline that takes 3D image data (slices of 2D images) and displays it with a vtkImageViewer2 (with a slider to move through the slices). My datasets can get huge, so I am looking for a way to only load part of the image into memory at a time as needed. I tried using vtkImageDataStreamer without success, though I have a feeling that's not for image viewing, but rather processing. How can I accomplish what I'm trying to do? Any help is appreciated! Here is my basic code for loading and displaying the data:</div><div id="yui_3_16_0_ym19_1_1481649367845_2527" dir="ltr"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2698">// load image data</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2699">vtkSmartPointer<vtkMetaImageReader> reader = vtkSmartPointer<vtkMetaImageReader>::New();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2700">reader->SetReleaseDataFlag(1);</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2701">reader->SetFileName("test.mhd");</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2702"><br id="yui_3_16_0_ym19_1_1481649367845_2703"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2704">// colormap</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2705">vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2706">lut->SetNumberOfColors(256);</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2707">lut->SetRange(0, 400);</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2708">lut->Build();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2709">for (size_t i = 0; i < 256; i++)</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2710"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1481649367845_2711">        </span>lut->SetTableValue(i, (double)i/256, (double)i/256, (double)i/256);</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2712"><br id="yui_3_16_0_ym19_1_1481649367845_2713"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2714">vtkSmartPointer<vtkImageMapToColors> maptoc =</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2715"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1481649367845_2716">       </span>vtkSmartPointer<vtkImageMapToColors>::New();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2717">maptoc->SetLookupTable(lut);</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2718">maptoc->SetInputConnection(reader->GetOutputPort());</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2719">maptoc->Update();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2720"><br id="yui_3_16_0_ym19_1_1481649367845_2721"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2722">// rendering</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2723">viewer = vtkSmartPointer<vtkImageViewer2>::New();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2724">viewer->SetInputConnection(maptoc->GetOutputPort());</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2725">viewer->SetRenderWindow(window->GetRenderWindow());</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2726">viewer->GetRenderer()->ResetCamera();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2727">viewer->Render();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2727"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2727">// note that window is of type QVTKWidget</div><div dir="ltr" id="yui_3_16_0_ym19_1_1481649367845_2727">// when the user changes slices, I call viewer->SetSlice</div></div></body></html>