[vtkusers] 3D Rendering of an sliced object

Sylvain Jaume sylvain.jaume at kitware.com
Fri Nov 11 16:33:29 EST 2005


Hi OnezerO,

You need the top and bottom slices to have the same intensity as the 
image background.
If inside your tubes you have an intensity equal to zero, pad your image 
with zeros.

Best,
Sylvain
PS: Please use English when sending emails to the vtkusers mailing list.

OnezerO wrote:

>Hola!
>Haré el cambio de extent por scalarRange, y probaré que sucede.
>Ya me di cuenta de donde nace el problema,
>La imagen original consta de 1 imagen negra, una serie de imágenes con el
>"tubo" y una imagen negra.
>Pero despues de procesar la imagen con algunos filtros de itk, las imágenes
>negras se modifican y obtengo dos contornos que no existen.
>
>¿Cuál es la diferencia entre que el fondo sea negro o sea blanco?
>Gracias
>
>-----Mensaje original-----
>De: Sylvain Jaume [mailto:sylvain.jaume at kitware.com] 
>Enviado el: Viernes, 11 de Noviembre de 2005 17:41
>Para: OnezerO
>Asunto: Re: [vtkusers] 3D Rendering of an sliced object
>
>Hola OnezerO,
>
>Puedes intentar eso:
>
>double scalarRange[2];
>importer->GetOutput()->GetScalarRange(scalarRange);
>
>[snip]
>
>imageConstantPad->SetConstant(scalarRange[1]);
>
>
>Si eso no funcciona, mandame la imagen que mandasta al principio. Ya no me
>acuerdo si el fundo de tu imagen es blanco o negro.
>
>!Mucha suerte con tu examen!
>Sylvain
>
>OnezerO wrote:
>
>  
>
>>Hello Sylvain, thanks a lot for your help in this matter.
>> 
>>Well, i finally can do the thing of the "extend", but i get to another 
>>problem... i obtain the image that i attach to this message, but i 
>>need to be otherwise, i mean, the "hole" part to be "tapped" and the 
>>outside part to be open... i hope i express well, cause the english 
>>are not my natural language.
>>
>>Thanks
>> 
>>----------------------------------------------------------------------
>>--
>>*De:* Sylvain Jaume [mailto:sylvain.jaume at kitware.com]
>>*Enviado el:* Miércoles, 09 de Noviembre de 2005 13:24
>>*Para:* OnezerO
>>*CC:* vtkusers at vtk.org
>>*Asunto:* Re: [vtkusers] 3D Rendering of an sliced object
>>
>>Hi OnezerO,
>>
>>You can find the manpages for every VTK class here:
>>http://www.vtk.org/doc/nightly/html/classes.html
>>
>>and here for vtkContourFilter:
>>http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html
>>
>>For more information, check the VTK book:
>>http://www.kitware.com/products/vtktextbook.html
>>
>>Cheers,
>>Sylvain
>>
>>OnezerO wrote:
>>
>>    
>>
>>>Meanwhile i do this, do you know where i can find the theory of the 
>>>vtkContour, to add to my final report.
>>>
>>>Saludos,
>>>OnezerO
>>>
>>>-----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