[vtkusers] Fwd: Slow Dicom blend mode.

Alessandro Martini alessandromartini at gmail.com
Thu Oct 14 13:19:12 EDT 2010


David,

I'm using a cone-beam head ct, the sample volume that I'm using have a
scalar opacity map from -3024 to 7190, and the bones appear after 200 (in
another software I'm using a ramp from 200 to 7190). I have tried some
numbers to check this, but in any case the composite mode dont show
anything, you can see this on the images attached.

Thank in advance,
Alessandro Martini

On Wed, Oct 13, 2010 at 4:35 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Allessandro,
>
> The three transfer functions in that example (the volumeColor,
> volumeScalarOpacity, and volumeGradientOpacity) are hard-coded for the
> headsq/quarter images in VTKData.  To use them with any other volume,
> you must change the values.
>
>  volumeColor->AddRGBPoint(0, 0.0, 0.0, 0.0);
>  volumeColor->AddRGBPoint(500, 1.0, 0.5, 0.3);
>  volumeColor->AddRGBPoint(1000, 1.0, 0.5, 0.3);
>  volumeColor->AddRGBPoint(1150, 1.0, 1.0, 0.9);
>
>  volumeScalarOpacity->AddPoint(0, 0.00);
>  volumeScalarOpacity->AddPoint(500, 0.15);
>  volumeScalarOpacity->AddPoint(1000, 0.15);
>  volumeScalarOpacity->AddPoint(1150, 0.85);
>
> These are made for a volume with intensity values that approximately
> range from 0 to 1200.  Find the intensity range of your DICOM data and
> adjust them accordingly.  Then you will be able to use "Composite" for
> your volume rendering.
>
>  David
>
>
> On Wed, Oct 13, 2010 at 1:09 AM, Alessandro Martini
> <alessandromartini at gmail.com> wrote:
> > I get the medical4.cxx example and change it to open a dicom file,
> resulting
> > this code, but with SetBlendModeToComposite the volume dond appear, and
> > SetBlendModeToAdictive is to much slow, what I need to use
> > SetBlendModeToComposite?
> >
> >         vtkSmartPointer<vtkRenderer>ren = vtkWindow1->GetRenderer();
> >         vtkSmartPointer<vtkRenderWindowInteractor>iren =
> >         vtkWindow1->GetInteractor();
> >
> >         vtkSmartPointer<vtkDICOMImageReader>dicomReader =
> >         vtkSmartPointer<vtkDICOMImageReader>::New();
> >         dicomReader->SetDirectoryName(dirname);
> >         dicomReader->Update();
> >
> >         vtkSmartPointer<vtkSmartVolumeMapper>volumeMapper =
> >         vtkSmartPointer<vtkSmartVolumeMapper>::New();
> >         volumeMapper->SetInput(dicomReader->GetOutput());
> >
> > -->>        volumeMapper->SetBlendModeToAdditive();
> > <<--
> >
> >         vtkSmartPointer<vtkColorTransferFunction>volumeColor =
> >         vtkSmartPointer<vtkColorTransferFunction>::New();
> >         volumeColor->AddRGBPoint(0, 0.0, 0.0, 0.0);
> >         volumeColor->AddRGBPoint(500, 1.0, 0.5, 0.3);
> >         volumeColor->AddRGBPoint(1000, 1.0, 0.5, 0.3);
> >         volumeColor->AddRGBPoint(1150, 1.0, 1.0, 0.9);
> >
> >         vtkSmartPointer<vtkPiecewiseFunction>volumeScalarOpacity =
> >         vtkSmartPointer<vtkPiecewiseFunction>::New();
> >         volumeScalarOpacity->AddPoint(0, 0.00);
> >         volumeScalarOpacity->AddPoint(500, 0.15);
> >         volumeScalarOpacity->AddPoint(1000, 0.15);
> >         volumeScalarOpacity->AddPoint(1150, 0.85);
> >
> >         vtkSmartPointer<vtkPiecewiseFunction>volumeGradientOpacity =
> >         vtkSmartPointer<vtkPiecewiseFunction>::New();
> >         volumeGradientOpacity->AddPoint(0, 0.0);
> >         volumeGradientOpacity->AddPoint(90, 0.5);
> >         volumeGradientOpacity->AddPoint(100, 1.0);
> >
> >         vtkSmartPointer<vtkVolumeProperty>volumeProperty =
> >         vtkSmartPointer<vtkVolumeProperty>::New();
> >         volumeProperty->SetColor(volumeColor);
> >         volumeProperty->SetScalarOpacity(volumeScalarOpacity);
> >         volumeProperty->SetGradientOpacity(volumeGradientOpacity);
> >         volumeProperty->SetInterpolationTypeToLinear();
> >         volumeProperty->ShadeOn();
> >         volumeProperty->SetAmbient(0.4);
> >         volumeProperty->SetDiffuse(0.6);
> >         volumeProperty->SetSpecular(0.2);
> >
> >         vtkSmartPointer<vtkVolume>volume =
> > vtkSmartPointer<vtkVolume>::New();
> >         volume->SetMapper(volumeMapper);
> >         volume->SetProperty(volumeProperty);
> >
> >         ren->AddViewProp(volume);
> >
> >         vtkCamera *camera = ren->GetActiveCamera();
> >         double *c = volume->GetCenter();
> >         camera->SetFocalPoint(c[0], c[1], c[2]);
> >         camera->SetPosition(c[0] + 400, c[1], c[2]);
> >         camera->SetViewUp(0, 0, -1);
> >
> >         vtkWindow1->Invalidate();
> >
> >         iren->Initialize();
> >         iren->Start();
> >
> > Thank's,
> > Alessandro Martini
> > alessandromartini at gmail.com
> > -------------------------------------------------
> > 'Existem 10 tipos de pessoas no mundo:
> > aquelem que entendem binário, e aqueles que não!'
> >
> > _______________________________________________
> > 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
> >
> >
>



-- 
Alessandro Martini
alessandromartini at gmail.com
-------------------------------------------------
'Existem 10 tipos de pessoas no mundo:
aquelem que entendem binário, e aqueles que não!'



-- 
Alessandro Martini
alessandromartini at gmail.com
-------------------------------------------------
'Existem 10 tipos de pessoas no mundo:
aquelem que entendem binário, e aqueles que não!'



-- 
Alessandro Martini
alessandromartini at gmail.com
-------------------------------------------------
'Existem 10 tipos de pessoas no mundo:
aquelem que entendem binário, e aqueles que não!'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101014/04cd37db/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Additive.jpg
Type: image/jpeg
Size: 76912 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101014/04cd37db/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Composite.jpg
Type: image/jpeg
Size: 33803 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101014/04cd37db/attachment-0001.jpg>


More information about the vtkusers mailing list