[vtkusers] volume rendering image decimation

Sergio Aguirre sergio.aguirre at gmail.com
Tue Oct 11 12:46:46 EDT 2011


Karthik

Thank you for the reply.

As you probably saw I was using vtkGPUVolumeRayCastMapper, I am running a
win7 64bit system with a Xeon quad core processor and an Nvidia Quadro FX
3700.

I expected it to perform well. But after modifying the transfer function
parameters I would still get very little of the image visible using either
 SetBlendModeToComposite OR SetBlendModeToAdditive

Minimum and Maximum Intensity Projection worked OK, but its not really the
visual effect I am looking for.

I then switched to vtkFixedPointVolumeRayCastMapper and composite and
additive look fine ONLY when setting the
LockSampleDistanceToInputSpacingOn()

My data sets are rather large (800+ Dicom Images), could it be that the
render time allotted to the volume is not enough?

I will continue to try and get the GPU one working, but will use fixedpoint
to move forward.

Thank you again!
Sergio

On Mon, Oct 10, 2011 at 9:02 PM, Karthik Krishnan <
karthik.krishnan at kitware.com> wrote:

> On Tue, Oct 11, 2011 at 12:59 AM, Sergio Aguirre <sergio.aguirre at gmail.com
> > wrote:
>
>> Hi everyone
>>
>> I am experiencing some unconventional results when doing volume
>> rendering.
>>
>> 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.
>>
>
> Sergio:
>
> 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.
>
> --
> karthik
>
>
> Did you load the dataset in VolView or 3D slicer and see if the dataset
>
>>
>> I updated the vtkGPUVolumeRayCastMapper SetSampleDistance to the same
>> spacing I use in vtkImageChangeInformation with no change in the output.
>>
>> Can anyone suggest what I am missing?
>>
>> Sergio
>>
>> //// code
>>
>> double opacityWindow = 2000.0;
>> double opacityLevel = 1.0;
>>
>> vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();
>>
>> dicomReader->SetDirectoryName("C:/Users/echopixel-01/Desktop/images/t120");
>>  dicomReader->Update();
>>
>> vtkImageData *dcmImage = vtkImageData::New();
>>  dcmImage = dicomReader->GetOutput();
>> dcmImage->Update();
>>
>>  vtkImageChangeInformation *iChange = vtkImageChangeInformation::New();
>> iChange->SetInput(dcmImage);
>>  iChange->SetOutputSpacing(0.000125, 0.000125, 0.0002);
>> iChange->Update();
>>
>> vtkColorTransferFunction *colorFun = vtkColorTransferFunction::New();
>> colorFun->AddRGBSegment(opacityLevel - 0.5*opacityWindow, 0.0, 0.0, 0.0,
>> opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 );
>>
>> vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New();
>> opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0,
>> opacityLevel + 0.5*opacityWindow, 1.0 );
>>
>> vtkVolumeProperty *property1 = vtkVolumeProperty::New();
>> property1->SetIndependentComponents(true);
>>  property1->SetColor( colorFun );
>> property1->SetScalarOpacity( opacityFun );
>>  property1->SetInterpolationTypeToLinear();
>>
>> vtkVolume *volume = vtkVolume::New();
>>  vtkGPUVolumeRayCastMapper *mapper = vtkGPUVolumeRayCastMapper::New();
>>
>>         mapper->SetInputConnection(iChange->GetOutputPort());
>>  mapper->SetBlendModeToComposite();
>> mapper->AutoAdjustSampleDistancesOff();
>>  mapper->SetSampleDistance(0.000125);
>>
>> volume->SetProperty( property1 );
>>  volume->SetMapper( mapper );
>> volume->SetPosition(0.0, 0.0, 0.0);
>> volume->SetOrigin(0.0, 0.0, 0.0);
>>  volume->Update();
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111011/29387bc3/attachment.htm>


More information about the vtkusers mailing list