[vtkusers] How to use vtkCellDerivatives with unstructured grid image
Dominik Szczerba
dominik at itis.ethz.ch
Fri Jun 17 08:17:06 EDT 2011
I inferred the order from the code.
Dominik
On Fri, Jun 17, 2011 at 2:39 AM, Seth Gilchrist <seth at mech.ubc.ca> wrote:
> Hi Dominik,
> thanks for your reply, this makes sense and was along the lines of what I
> have been trying. Can you tell me how you arrived at 0, and 1 for the
> fieldAssociation values? Is that just the order of the enumerator list
> located at:
>
> http://www.vtk.org/doc/nightly/html/classvtkDataObject.html#a54fdf8345a01c89e618feca3c10002b1
>
> Thanks,
> Seth
>
>
>
>
>
> On Wed, Jun 15, 2011 at 3:12 PM, Dominik Szczerba <dominik at itis.ethz.ch>
> wrote:
>>
>> I never used the filter (in such cases I recommend custom filters) but
>> may be able to clarify some confusion about SetInputArrayToProcess. It
>> just explicitly tells the filter which array and of which type to take
>> in case there are multiple ones:
>>
>>
>> http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a6bea16e1329609dbccce0ff8d2367484
>>
>> Typical use:
>>
>> SetInputArrayToProcess(0,0,0,0,"PointScalar");
>> SetInputArrayToProcess(0,0,0,1,"CellMarker");
>>
>> Good luck
>> Dominik
>>
>>
>> On Wed, Jun 15, 2011 at 8:25 PM, Seth Gilchrist <seth at mech.ubc.ca> wrote:
>> > Hello,
>> > Sorry to bump, but I'm still struggling with this and can't find any
>> > good help in my books or online. I have the "VTK Users Guide" and
>> > "The Visualization Toolkit: An Object-Oriented Approach to 3-D
>> > Graphics," but neither of them is any help in this case.
>> >
>> > Can anybody help with this question? Examples, hints, whatever you
>> > can do is really appreciated.
>> >
>> > Cheers,
>> > Seth
>> >
>> > Previous message:
>> > Hello,
>> > I have the unstructured grid image printed at end of this email, with
>> > two
>> > point data sets "Dispamcement" (vectors) and "Optimizer Value"
>> > (scalors). I
>> > want to use vtkCellDerivatives to calculate the strain tensors from the
>> > "Displacement" point data. I can't figure out how to input the data
>> > into
>> > vtkCellDerivatives. I have tried:
>> >
>> > vtkCellDerivatives *dCalc = vtkCellDerivatives::New();
>> > dCalc->
>> > SetTensorModeToComputeStrain();
>> > dCalc->SetInput( image->GetPointData()->GetArray("Displacement") );
>> > dCalc->Update();
>> >
>> > and
>> >
>> > vtkCellDerivatives *dCalc = vtkCellDerivatives::New();
>> > dCalc->SetTensorModeToComputeStrain();
>> > dCalc->SetInput(image);
>> > dCalc->SetInputArrayToProcess( [uh...I get lost here, I've tried a lot
>> > of
>> > things] );
>> > dCalc->Update();
>> >
>> > I either can't get it to compile, or the output of the filter is the
>> > same as
>> > the input.
>> >
>> > Can anybody point me in the right direction?
>> >
>> > Thanks,
>> > Seth
>> >
>> > The cells in the image are quadratic tets.
>> >
>> > image->Print( std::cout )...
>> >
>> > vtkUnstructuredGrid (0x10f1150)
>> > Debug: Off
>> > Modified Time: 268
>> > Reference Count: 1
>> > Registered Events: (none)
>> > Source: (none)
>> > Information: 0x10e6130
>> > Data Released: False
>> > Global Release Data: Off
>> > UpdateTime: 269
>> > Release Data: Off
>> > UpdateExtent: Not Initialized
>> > Update Number Of Pieces: 1
>> > Update Piece: 0
>> > Update Ghost Level: 0
>> > MaximumNumberOfPieces: 1
>> > RequestExactExtent: Off
>> > Field Data:
>> > Debug: Off
>> > Modified Time: 252
>> > Reference Count: 1
>> > Registered Events: (none)
>> > Number Of Arrays: 0
>> > Number Of Components: 0
>> > Number Of Tuples: 0
>> > Number Of Points: 81
>> > Number Of Cells: 30
>> > Cell Data:
>> > Debug: Off
>> > Modified Time: 259
>> > Reference Count: 1
>> > Registered Events: (none)
>> > Number Of Arrays: 0
>> > Number Of Components: 0
>> > Number Of Tuples: 0
>> > Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
>> > Interpolate Flags: ( 1 1 1 1 1 0 0 )
>> > Pass Through Flags: ( 1 1 1 1 1 1 1 )
>> > Scalars: (none)
>> > Vectors: (none)
>> > Normals: (none)
>> > TCoords: (none)
>> > Tensors: (none)
>> > GlobalIds: (none)
>> > PedigreeIds: (none)
>> > Point Data:
>> > Debug: Off
>> > Modified Time: 268
>> > Reference Count: 1
>> > Registered Events: (none)
>> > Number Of Arrays: 2
>> > Array 0 name = Displacement
>> > Array 1 name = Optimizer Value
>> > Number Of Components: 4
>> > Number Of Tuples: 81
>> > Copy Tuple Flags: ( 1 1 1 1 1 0 1 )
>> > Interpolate Flags: ( 1 1 1 1 1 0 0 )
>> > Pass Through Flags: ( 1 1 1 1 1 1 1 )
>> > Scalars: (none)
>> > Vectors: (none)
>> > Normals: (none)
>> > TCoords: (none)
>> > Tensors: (none)
>> > GlobalIds: (none)
>> > PedigreeIds: (none)
>> > Bounds:
>> > Xmin,Xmax: (57.5, 67.3)
>> > Ymin,Ymax: (45.7, 56.7)
>> > Zmin,Zmax: (41.7, 59.1)
>> > Compute Time: 283
>> > Number Of Points: 81
>> > Point Coordinates: 0x10e7890
>> > Locator: 0
>> > Number Of Pieces: 1
>> > Piece: 0
>> > Ghost Level: 0
>> > _______________________________________________
>> > 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