[vtkusers] Real colours in 3D CT image(DICOM)

Gururajan.R gururajan.r at raster.in
Mon Oct 5 09:34:09 EDT 2009


real bone, vessels , blood  these are the colour should be applied to
relevant parts of the image.

thanks
guru
Bill Lorensen wrote:
> What do you mean by realistic color?
>
> On Mon, Oct 5, 2009 at 8:46 AM, Gururajan.R <gururajan.r at raster.in> wrote:
>   
>> Bill
>>
>>    Again very very kind to you,
>>    After that also am not getting the realistic color for my image. plz
>> have a lokk at below code.
>>
>>  Please suggest me, where exactly have to change.
>>
>> thank you so much for your kind help
>>
>> Thanks
>> guru
>>
>>            vtkGeometryFilter  geovolumebone = new vtkGeometryFilter();
>>                geovolumebone.SetInput(polyReader.GetOutput());
>>                vtkPolyDataMapper  geobonemapper = new vtkPolyDataMapper();
>>                geobonemapper.SetInput(geovolumebone.GetOutput());
>>                geobonemapper.ScalarVisibilityOff();
>>
>>                vtkLODActor boneActor = new vtkLODActor();
>>                boneActor.SetNumberOfCloudPoints(100000);
>>                boneActor.SetMapper(geobonemapper);
>>                boneActor.GetProperty().SetColor(0.75,0.75,0.75);
>>                boneActor.GetProperty().SetOpacity(0.3);
>>                boneActor.GetProperty().SetDiffuse(0.75);
>>                boneActor.GetProperty().SetSpecular(0.75);
>>
>> Bill Lorensen wrote:
>>     
>>> Opacity, Diffuse, and Specular have ranges from 0-1. Some of your
>>> settings are > 1.0.
>>>
>>> Start out just by setting the diffuse color. Leave out all of the
>>> other settings until you get a decent image. Then you can add specular
>>> highlights later.
>>>
>>> On Sat, Oct 3, 2009 at 9:25 AM, Gururajan.R <gururajan.r at raster.in> wrote:
>>>
>>>       
>>>> Bill
>>>> very kind to your reply.
>>>>
>>>>
>>>> i have included that too, to set scalar visibility in off. even i dint get the result, am wondering where i made mistake.
>>>> if time permits you please have a look on below code
>>>>
>>>> Thanks
>>>> Guru
>>>>
>>>>    //for skin and bone Diagram
>>>>            //For setting Bone Colour
>>>>                vtkGeometryFilter  geovolumebone = new vtkGeometryFilter();
>>>>                geovolumebone.SetInput(polyReader.GetOutput());
>>>>                vtkPolyDataMapper  geobonemapper = new vtkPolyDataMapper();
>>>>                geobonemapper.SetInput(geovolumebone.GetOutput());
>>>>                geobonemapper.ScalarVisibilityOff();
>>>>                //vtkActor boneActor = new vtkActor();
>>>>                vtkLODActor boneActor = new vtkLODActor();
>>>>                boneActor.SetNumberOfCloudPoints(100000);
>>>>                boneActor.SetMapper(geobonemapper);
>>>>                //boneActor.GetProperty().SetColor(1, 0.4782, 0.2546);
>>>>                boneActor.GetProperty().SetColor(1, 0, 0);
>>>>                //boneActor.GetProperty().SetDiffuseColor(1, 1, .9412);
>>>>                boneActor.GetProperty().SetSpecularPower(100);
>>>>                boneActor.GetProperty().SetOpacity(1.5);
>>>>                boneActor.GetProperty().SetDiffuse(1.75);
>>>>                boneActor.GetProperty().SetSpecular(1.75);
>>>>                //For setting Bone Colour
>>>>
>>>>            //For setting Skin Colour
>>>>                vtkMarchingCubes skin = new vtkMarchingCubes();
>>>>                skin.SetInput(dicomreader.GetOutput());
>>>>                skin.SetValue(0, -300);
>>>>                skin.ComputeNormalsOn();
>>>> //
>>>>                vtkGeometryFilter geovolumeSkin = new vtkGeometryFilter();
>>>>                geovolumeSkin.SetInput(contour.GetOutput());
>>>> //
>>>>                vtkPolyDataMapper skinmapper = new vtkPolyDataMapper();
>>>>                skinmapper.SetInput(geovolumeSkin.GetOutput());
>>>>                skinmapper.ScalarVisibilityOff();
>>>>
>>>>
>>>>                vtkLODActor actorskin = new vtkLODActor();
>>>>                actorskin.SetNumberOfCloudPoints(100000);
>>>>                actorskin.SetMapper(skinmapper);
>>>>                //actorskin.GetProperty().SetColor(1, 0.547237, 0.319073);
>>>>                actorskin.GetProperty().SetColor(0.94,0.58, 0.17);
>>>>                actorskin.GetProperty().SetSpecularPower(100);
>>>>                actorskin.GetProperty().SetOpacity( 3.3 );
>>>>
>>>> Bill Lorensen wrote:
>>>>
>>>>         
>>>>> Try adding:
>>>>> geobonemapper->ScalarVisibilityOff();
>>>>>
>>>>> If scalar data exists for cells or points, the mapper will use that
>>>>> data to color the actor. With ScalarVisibilityOff(), the mapper will
>>>>> use the color in the property.
>>>>>
>>>>> On Sat, Oct 3, 2009 at 1:34 AM, Gururajan.R <gururajan.r at raster.in> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> Hi all,
>>>>>>    As am a new in VTK. Please guide me how to bring real colors like
>>>>>> (bone, blood & vessles) in 3d image, iam reading dicom series and
>>>>>> converted into 3d format. using vtkLODActor, am colouring the image but
>>>>>> its not a real color and  the whole image is in one color only.
>>>>>>
>>>>>> i want real color to be applied to the relevant parts in the 3d image .
>>>>>>
>>>>>> Please any one help me in this., i would be very thankful for your kind
>>>>>> help.
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>> Guru
>>>>>>
>>>>>>    vtkLODActor boneActor = new vtkLODActor();
>>>>>>                boneActor.SetNumberOfCloudPoints(100000);
>>>>>>                boneActor.SetMapper(geobonemapper);
>>>>>>                //boneActor.GetProperty().SetColor(1, 0.4782, 0.2546);
>>>>>>                boneActor.GetProperty().SetColor(1, 0.75, 0.5);
>>>>>>                //boneActor.GetProperty().SetColor(1, 0.3, 0.3);
>>>>>>
>>>>>>
>>>>>>                boneActor.GetProperty().SetOpacity(1.5);
>>>>>>                boneActor.GetProperty().SetDiffuse(1.75);
>>>>>>                boneActor.GetProperty().SetSpecular(1.75);
>>>>>>                boneActor.GetProperty().SetSpecular(0.3);
>>>>>>                boneActor.GetProperty().SetSpecularPower(20);
>>>>>>                boneActor.GetProperty().SetOpacity( 3.3 );
>>>>>>                boneActor.GetProperty().SetDiffuse(0.8);
>>>>>>                boneActor.GetProperty().SetAmbient(2.2);
>>>>>> _______________________________________________
>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>     




More information about the vtkusers mailing list