<div><div class="gmail_quote">On Tue, Oct 11, 2011 at 12:59 AM, Sergio Aguirre <span dir="ltr"><<a href="mailto:sergio.aguirre@gmail.com">sergio.aguirre@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi everyone <div><br></div><div>I am experiencing some unconventional results when doing volume rendering. </div><div><br></div><div>I need to adjust the pixel spacing of my image using vtkImageChangeInformation to show real physical dimensions. When I apply that filter only some parts of the volume rendered image are visible others simply do not appear. </div>
</blockquote><div><br></div>Sergio:<div><br></div><div>As a rule of thumb the sample distance should be half the minimum spacing of the dataset. It is likely that this has nothing to do with the change information filter. You may have setup an inappropriate transfer function. Did you try to use the vtkFixedPointVolumeRayCastMapper first ? What GPU do you have ? I'd recommend using VolView or 3DSlicer to load the dataset, use the UI to get a reasonable visualization and then translate the result (transfer function parameters) into code.</div>
<div><br></div><div>--</div><div>karthik</div><div><br></div><div><br></div><div>Did you load the dataset in VolView or 3D slicer and see if the dataset </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><br></div><div>I updated the vtkGPUVolumeRayCastMapper SetSampleDistance to the same spacing I use in vtkImageChangeInformation with no change in the output. </div><div><br></div><div>Can anyone suggest what I am missing? </div>
<div><br>Sergio </div><div><br></div><div>//// code </div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>double opacityWindow = 2000.0;</div><div><span style="white-space:pre-wrap">        </span>double opacityLevel = 1.0;</div>
<div><br></div><div><span style="white-space:pre-wrap">        </span>vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();</div><div><span style="white-space:pre-wrap">        </span>dicomReader->SetDirectoryName("C:/Users/echopixel-01/Desktop/images/t120");</div>
<div><span style="white-space:pre-wrap">        </span>dicomReader->Update();</div></div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>vtkImageData *dcmImage = vtkImageData::New(); </div>
<div><span style="white-space:pre-wrap">        </span>dcmImage = dicomReader->GetOutput(); </div><div><span style="white-space:pre-wrap">        </span>dcmImage->Update(); </div></div><div><br>
</div><div><div><span style="white-space:pre-wrap">        </span>vtkImageChangeInformation *iChange = vtkImageChangeInformation::New(); </div><div><span style="white-space:pre-wrap">        </span>iChange->SetInput(dcmImage); </div>
<div><span style="white-space:pre-wrap">        </span>iChange->SetOutputSpacing(0.000125, 0.000125, 0.0002); </div><div><span style="white-space:pre-wrap">        </span>iChange->Update(); </div>
</div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>vtkColorTransferFunction *colorFun = vtkColorTransferFunction::New();</div><div><span style="white-space:pre-wrap">        </span>colorFun->AddRGBSegment(opacityLevel - 0.5*opacityWindow, 0.0, 0.0, 0.0, opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 );</div>
<div><br></div><div><span style="white-space:pre-wrap">        </span>vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New();</div><div><span style="white-space:pre-wrap">        </span>opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, opacityLevel + 0.5*opacityWindow, 1.0 );</div>
</div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>vtkVolumeProperty *property1 = vtkVolumeProperty::New();</div><div><span style="white-space:pre-wrap">        </span>property1->SetIndependentComponents(true);</div>
<div><span style="white-space:pre-wrap">        </span>property1->SetColor( colorFun );</div><div><span style="white-space:pre-wrap">        </span>property1->SetScalarOpacity( opacityFun );</div>
<div><span style="white-space:pre-wrap">        </span>property1->SetInterpolationTypeToLinear();</div></div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>vtkVolume *volume = vtkVolume::New();</div>
<div><span style="white-space:pre-wrap">        </span>vtkGPUVolumeRayCastMapper *mapper = vtkGPUVolumeRayCastMapper::New();</div></div><div><br></div><div> mapper->SetInputConnection(iChange->GetOutputPort());</div>
<div><span style="white-space:pre-wrap">        </span>mapper->SetBlendModeToComposite();</div><div><div><span style="white-space:pre-wrap">        </span>mapper->AutoAdjustSampleDistancesOff(); </div>
<div><span style="white-space:pre-wrap">        </span>mapper->SetSampleDistance(0.000125); </div></div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>volume->SetProperty( property1 );</div>
<div><span style="white-space:pre-wrap">        </span>volume->SetMapper( mapper );</div><div><span style="white-space:pre-wrap">        </span>volume->SetPosition(0.0, 0.0, 0.0); </div><div><span style="white-space:pre-wrap">        </span>volume->SetOrigin(0.0, 0.0, 0.0); </div>
<div><span style="white-space:pre-wrap">        </span>volume->Update(); </div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>