[vtkusers] 3D Rendering of an sliced object

OnezerO onezerostyle at gmail.com
Tue Nov 8 17:51:18 EST 2005


Because the image that i import is like a tube inside a empty tube 

-----Mensaje original-----
De: Sylvain Jaume [mailto:sylvain.jaume at kitware.com] 
Enviado el: Martes, 08 de Noviembre de 2005 17:46
Para: OnezerO
CC: vtkusers at vtk.org
Asunto: Re: [vtkusers] 3D Rendering of an sliced object

Hi OnezerO,

What is wrong with showing part of a cube during your final examination?
Alternatively you could try this:

double scalarRange[2];
importer->GetOutput()->GetScalarRange(scalarRange);

[snip]

imageConstantPad->SetConstant(scalarRange[0]);

Cheers,
Sylvain

OnezerO wrote:

>Ok, but the extent thing dindt work, even make another kind of image, 
>like a part of a cube, didnt, work
>
>-----Mensaje original-----
>De: Sylvain Jaume [mailto:sylvain.jaume at kitware.com]
>Enviado el: Martes, 08 de Noviembre de 2005 17:04
>Para: OnezerO
>CC: vtkusers at vtk.org
>Asunto: Re: [vtkusers] 3D Rendering of an sliced object
>
>Hi OnezerO,
>
>Before your final examination, make these changes to your code:
>
>// executing the filter
>m_vtkImporter->Update();
>
>// getting the extent of the input image m_vtkImporter->GetWholeExtent( 
>extent );
>
>// creating the extent for an image that has one more 'slice'
>// in the 6 directions around the input image
>
>	extent[0]--;
>	extent[1]++;
>	extent[2]--;
>	extent[3]++;
>	extent[4]--;
>	extent[5]++;
>
>// creating the extended image, so the input image is padded with zeros 
>// i.e. black voxels vtkImageConstantPad  *m_vtkConstant = 
>vtkImageConstantPad::New(); m_vtkConstant->SetInput(
>m_vtkImporter->GetOutput() ); m_vtkConstant->SetOutputWholeExtent( 
>extent );
>
>
>Cheers,
>Sylvain
>
>OnezerO wrote:
>
>  
>
>>Can you explain me that uses of this "extent"? 
>>Because if this get to work i have to present this in a final 
>>examination and i have to know how to works every part of the code 
>>Thanks
>>
>>-----Mensaje original-----
>>De: Sylvain Jaume [mailto:sylvain.jaume at kitware.com]
>>Enviado el: Martes, 08 de Noviembre de 2005 13:41
>>Para: OnezerO
>>CC: vtkusers at vtk.org
>>Asunto: Re: [vtkusers] 3D Rendering of an sliced object
>>
>>Hi OnezerO,
>>
>>Could you try the code I sent you in my previous email (see below)?
>>
>>Cheers,
>>Sylvain
>>
>>OnezerO wrote:
>>
>> 
>>
>>    
>>
>>>Dont work
>>>
>>>I did that:
>>>ConnectPipelines(m_itkExporter , m_vtkImporter );
>>>m_vtkImporter->Update();     
>>>
>>>vtkImageConstantPad  *m_vtkConstant = vtkImageConstantPad::New(); 
>>>m_vtkConstant->SetInput( m_vtkImporter->GetOutput() );
>>>
>>>vtkContourFilter *m_vtkContour = vtkContourFilter::New(); 
>>>m_vtkContour->SetInput( m_vtkConstant->GetOutput() );
>>>
>>>The 3d image obtained its equals to the previous one
>>>
>>>
>>>You say i should try this extent thing ?
>>>-----Mensaje original-----
>>>De: Sylvain Jaume [mailto:sylvain.jaume at kitware.com]
>>>Enviado el: Martes, 08 de Noviembre de 2005 13:06
>>>Para: OnezerO
>>>CC: vtkusers at vtk.org
>>>Asunto: Re: [vtkusers] 3D Rendering of an sliced object
>>>
>>>Hi OnezerO,
>>>
>>>The filter vtkImageConstantPad is in the Imaging directory:
>>>http://www.vtk.org/doc/nightly/html/classvtkImageConstantPad.html
>>>
>>>int extent[6];
>>>image->GetWholeExtent( extent )
>>>
>>>extent[0]--;
>>>extent[1]++;
>>>extent[2]--;
>>>extent[3]++;
>>>extent[4]--;
>>>extent[5]++;
>>>
>>>vtkImageConstantPad *constantPad = vtkImageConstantPad::New();
>>>constantPad->SetInput(image);
>>>constantPad->SetOutputWholeExtent(extent);
>>>
>>>vtkContourFilter *contourFilter = vtkContourFilter::New();
>>>contourFilter->SetInput(constantPad->GetOutput());
>>>
>>>Cheers,
>>>Sylvain
>>>
>>>OnezerO wrote:
>>>
>>>
>>>
>>>   
>>>
>>>      
>>>
>>>>i didnt find this filter :(
>>>>
>>>>-----Mensaje original-----
>>>>De: Sylvain Jaume [mailto:sylvain.jaume at kitware.com]
>>>>Enviado el: Martes, 08 de Noviembre de 2005 12:15
>>>>Para: OnezerO
>>>>CC: vtkusers at vtk.org
>>>>Asunto: Re: [vtkusers] 3D Rendering of an sliced object
>>>>
>>>>Hi OnezerO,
>>>>
>>>>Did you use vtkConstantPadFilter before applying vtkContourFilter as 
>>>>it was answered previously?
>>>>
>>>>Cheers,
>>>>Sylvain
>>>>
>>>>OnezerO wrote:
>>>>
>>>>
>>>>
>>>>  
>>>>
>>>>     
>>>>
>>>>        
>>>>
>>>>>Hello, i'm send this post again because i think that i dont explain 
>>>>>my problem very well... I have a series of images that represents a 
>>>>>3d figure, this images was preprocesing with itk i'm receiving it 
>>>>>with a Importer from vtk, i pass the data throught a Contourfilter 
>>>>>and then by a SmoothFilter, the resulting 3d images has openings 
>>>>>upside and downside, i wanna close this holes... how i do it???
>>>>>
>>>>>Regards
>>>>>
>>>>>
>>>>>-------------------------------------------------------------------
>>>>>-
>>>>>-
>>>>>-
>>>>>-
>>>>>-
>>>>>
>>>>>_______________________________________________
>>>>>This is the private VTK discussion list. 
>>>>>Please keep messages on-topic. Check the 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