[vtkusers] Re: What Is Wrong With My VTK Pipeline ?

Amy Squillacote amy.squillacote at kitware.com
Wed Sep 19 10:41:23 EDT 2007


Hi John,

The vtkImageMandelbrotSource produces only vtkImageData output; it does 
not produce vtkUnstructuredGrid. Please try the simple pipeline that 
Sylvain describes below. Only use vtkUnstructuredGridVolumeMapper 
classes if the dataset you are rendering is a vtkUnstructuredGrid.

- Amy

Sylvain Jaume wrote:
> Hi Mark,
>
> Please create this pipeline:
>
> vtkImageMandelbrotSource -> vtkVolumeTextureMapper3D
>
> You don't need to convert your vtkImageData to vtkUnstructuredGrid.
>
> You'll find an example of vtkVolumeTextureMapper3D here:
> VTK/VolumeRendering/Testing/Tcl/volTM3DCropRegions.tcl
>
> Sylvain
>
> JohnMark wrote:
>> thank you , Sylvain ,
>>     I have read the information of vtkImageMandelbrotSource , it says 
>> that vtkImageMandelbrotSource  creates an _*unsigned char image*_ of 
>> the _*Mandelbrot set*_ . and then I will ask if its data type is
>> vtkUnstructuredGrid and be used in vtkUnstructuredGridVolumeMapper , 
>> why can it create an unsigned
>> char image ? should I can consider it as a vtkImageData type ? and is 
>> there an clash between them ? a
>> Mandelbrot set woule have the vtkUnstructuredGrid and vtkImageData 
>> type at the same time ?
>>  
>>     thank you again !
>>  
>>     Mark
>>  
>>  
>>  
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>  > Date: Wed, 19 Sep 2007 09:54:40 -0400
>>  > From: sylvain.jaume at kitware.com
>>  > To: zhaojunxp at hotmail.com
>>  > CC: vtkusers at vtk.org
>>  > Subject: Re: What Is Wrong With My VTK Pipeline ?
>>  >
>>  > Mark,
>>  >
>>  > As Amy said, vtkImageMandelbrotSource is a source: it derived from
>>  > vtkAlgorithm, so it has a SetInputConnection method but *it cannot be
>>  > used*. Do not connect vtkVolume16Reader to vtkImageMandelbrotSource,
>>  > just use one or the other.
>>  >
>>  > Sincerely,
>>  > Sylvain
>>  >
>>  > JohnMark wrote:
>>  > > thank you , Sylvain ,
>>  > >
>>  > > I have send it to the maillist .
>>  > > I just see that vtkImageMandelbrotSource has an input port method :
>>  > > SetInputConnection() , and it
>>  > > can take vtkImageData as input ports , so I think it will be OK if
>>  > > I compile it . however , I get many
>>  > > errors from it . maybe I have to retest it now .
>>  > >
>>  > > thank you for your help again , sylvain .
>>  > >
>>  > > Mark
>>  > >
>>  > >
>>  > >
>>  > >
>>  > > 
>> ------------------------------------------------------------------------
>>  > >
>>  > > > Date: Wed, 19 Sep 2007 09:27:12 -0400
>>  > > > From: sylvain.jaume at kitware.com
>>  > > > To: zhaojunxp at hotmail.com; vtkusers at vtk.org
>>  > > > Subject: Re: What Is Wrong With My VTK Pipeline ?
>>  > > >
>>  > > > Hi Mark,
>>  > > >
>>  > > > (Please keep your postings to vtkusers mailing list.)
>>  > > >
>>  > > > vtkImageMandelbrotSource and vtkVolume16Reader are both 
>> sources, they
>>  > > > don't accept an input. They both produce a vtkImageData, so 
>> either use
>>  > > > one or the other for testing your application.
>>  > > >
>>  > > > You can convert a vtkImageData to a vtkUnstructuredGrid using
>>  > > > vtkThreshold. For volume rendering a vtkUnstructuredGrid, have 
>> a look at
>>  > > > the vtkUnstructuredGridVolumeRayCastMapper. You'll find an 
>> example in
>>  > > > VTK/Examples/VolumeRendering/Tcl/IntermixedUnstructuredGrid.tcl
>>  > > >
>>  > > > Sincerely,
>>  > > > Sylvain
>>  > > >
>>  > > > JohnMark wrote:
>>  > > > > Hi , Sylvain ,
>>  > > > > thank you for your help within these days . and this is one 
>> problem
>>  > > > > that my friend ask me , but I
>>  > > > > still don't know why it is , even though I have read the vtk 
>> user
>>  > > guide
>>  > > > > and so on :
>>  > > > > I have been testing some examples of cells during these days 
>> . and I
>>  > > > > find an interesting class :
>>  > > > > vtkImageMandelbrotSource , because its output can be used by 
>> volume
>>  > > > > rendering , although the volume
>>  > > > > rendering is unstructured grid volume rendering .
>>  > > > > and I find it has an input method : 
>> SetInputConnection(vtkDataObject
>>  > > > > *) , so I think it may be OK
>>  > > > > if I take the output of class vtkVolume16Reader as its input 
>> , but ,
>>  > > > > luckily , I get an error :
>>  > > > > Attempt to connect input port index 0 for an algorithm with 
>> 0 input
>>  > > > > ports . but in other examples of
>>  > > > > volume rendering , there is not any error like this , and 
>> all of them
>>  > > > > work well . so I don't think
>>  > > > > there is 0 input ports .
>>  > > > > the codes is just as follows :
>>  > > > >
>>  > > > > vtkVolume16Reader *reader = vtkVolume16Reader::New();//**** 
>> the v16
>>  > > > > codes is no problem , I have test it many times .
>>  > > > > reader->SetDataDimensions(64,64);
>>  > > > > reader->SetImageRange(1,93);
>>  > > > > reader->SetDataByteOrderToLittleEndian();
>>  > > > > reader->SetFilePrefix("../headsq/quarter");
>>  > > > > reader->SetDataSpacing(3.2, 3.2, 1.5);
>>  > > > > vtkImageMandelbrotSource *input = 
>> vtkImageMandelbrotSource::New();
>>  > > > > input->SetInputConnection(reader->GetOutputPort());
>>  > > > >
>>  > > > > so there are the problems :
>>  > > > > 1、of course , vtkImageMandelbrotSource can create images by 
>> itself
>>  > > > > , is it real that
>>  > > > > vtkImageMandelbrotSource can not take other images as input 
>> ports ?
>>  > > > > 2、if it is so , all the unstructured grid volume rendering 
>> methods
>>  > > > > can not take random images
>>  > > > > as their input ports ? if it is not , what should I do 
>> before I send
>>  > > > > the images (like .dcm images) to
>>  > > > > vtkImageMandelbrotSource ?
>>  > > > > and I have tried vtkUnstructuredGridAlgorithm , it can 
>> transform the
>>  > > > > images to unstructured grid ,
>>  > > > > just as the unstructured grid volume rendering requires , 
>> but it
>>  > > doesn't
>>  > > > > work .
>>  > > > > or in other words , these methods , like
>>  > > > > vtkUnstructuredGridVolumeZSweepMapper , can not be used
>>  > > > > by the medical visualization system , so which field can 
>> they be used ?
>>  > > > >
>>  > > > > thank you with great regards !
>>  > > > >
>>  > > > > Mark
>>  > > > >
>>  > > > >
>>  > > > >
>>  > > 
>> ------------------------------------------------------------------------
>>  > > > > 使用新一代 Hotmail,更强大、更安全、更多存储空间! 立刻体验!
>>  > > > > <http://www.hotmail.com>
>>  > >
>>  > >
>>  > > 
>> ------------------------------------------------------------------------
>>  > > 用 Windows Live Spaces 展示个性自我,与好友分享生活! 了解更多信 
>> 息!
>>  > > <http://spaces.live.com/?page=HP>
>>
>>
>> ------------------------------------------------------------------------
>> Windows Live Writer 让您告别龟速网络,轻松写日志! 立即使用! 
>> <http://writer.live.com/>
> _______________________________________________
> 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
>

-- 
Amy Squillacote
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
Phone: (518) 371-3971 x106




More information about the vtkusers mailing list