VTK  9.5.2
vtkImageData.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
24
25#ifndef vtkImageData_h
26#define vtkImageData_h
27
28#include "vtkCommonDataModelModule.h" // For export macro
29#include "vtkDataSet.h"
30#include "vtkSmartPointer.h" // For vtkSmartPointer ivars
31#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
32
33#include "vtkStructuredData.h" // Needed for inline methods
34
35VTK_ABI_NAMESPACE_BEGIN
36class vtkDataArray;
38class vtkLine;
39class vtkMatrix3x3;
40class vtkMatrix4x4;
41class vtkPixel;
42class vtkPoints;
43class vtkVertex;
44class vtkVoxel;
45
46class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkImageData : public vtkDataSet
47{
48public:
49 static vtkImageData* New();
51
52 vtkTypeMacro(vtkImageData, vtkDataSet);
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
59 void CopyStructure(vtkDataSet* ds) override;
60
64 void Initialize() override;
65
69 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_IMAGE_DATA; }
70
72
79 vtkIdType GetNumberOfCells() override;
81 vtkPoints* GetPoints() override;
82 double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override;
83 void GetPoint(vtkIdType id, double x[3]) override;
84 vtkCell* GetCell(vtkIdType cellId) override;
85 vtkCell* GetCell(int i, int j, int k) override;
86 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
87 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
89 vtkIdType FindPoint(double x[3]) override;
90 vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
91 double pcoords[3], double* weights) override;
92 vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
93 double tol2, int& subId, double pcoords[3], double* weights) override;
94 vtkCell* FindAndGetCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
95 double pcoords[3], double* weights) override;
96 int GetCellType(vtkIdType cellId) override;
98 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
99 VTK_SIZEHINT(pts, npts) override;
100 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
101 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override
102 {
103 int dimensions[3];
104 this->GetDimensions(dimensions);
105 vtkStructuredData::GetPointCells(ptId, cellIds, dimensions);
106 }
107 void ComputeBounds() override;
108 int GetMaxCellSize() override { return 8; } // voxel is the largest
109 int GetMaxSpatialDimension() override;
110 int GetMinSpatialDimension() override;
111 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
113
120
128
136 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds, int* seedLoc);
137
139
145 virtual void BlankPoint(vtkIdType ptId);
146 virtual void UnBlankPoint(vtkIdType ptId);
147 virtual void BlankPoint(int i, int j, int k);
148 virtual void UnBlankPoint(int i, int j, int k);
150
152
158 virtual void BlankCell(vtkIdType ptId);
159 virtual void UnBlankCell(vtkIdType ptId);
160 virtual void BlankCell(int i, int j, int k);
161 virtual void UnBlankCell(int i, int j, int k);
163
169 unsigned char IsPointVisible(vtkIdType ptId);
170
176 unsigned char IsCellVisible(vtkIdType cellId);
177
182 bool HasAnyBlankPoints() override;
183
188 bool HasAnyBlankCells() override;
189
193 vtkGetMacro(DataDescription, int);
194
201 void GetCellDims(int cellDims[3]);
202
206 virtual void SetDimensions(int i, int j, int k);
207
211 virtual void SetDimensions(const int dims[3]);
212
219 virtual int* GetDimensions() VTK_SIZEHINT(3);
220
227 virtual void GetDimensions(int dims[3]);
228#if VTK_ID_TYPE_IMPL != VTK_INT
229 virtual void GetDimensions(vtkIdType dims[3]);
230#endif
231
233
240 virtual int ComputeStructuredCoordinates(const double x[3], int ijk[3], double pcoords[3]);
242 const double x[3], int ijk[3], double pcoords[3], double tol2);
244
254 virtual void GetVoxelGradient(int i, int j, int k, vtkDataArray* s, vtkDataArray* g);
255
262 virtual void GetPointGradient(int i, int j, int k, vtkDataArray* s, double g[3]);
263
267 virtual int GetDataDimension();
268
272 virtual vtkIdType ComputePointId(int ijk[3])
273 {
275 }
276
280 virtual vtkIdType ComputeCellId(int ijk[3])
281 {
283 }
284
286
290 int axis, int min, int max, const int* updateExtent, int* axisUpdateExtent);
291 virtual void GetAxisUpdateExtent(int axis, int& min, int& max, const int* updateExtent);
293
295
306 virtual void SetExtent(int extent[6]);
307 virtual void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
308 vtkGetVector6Macro(Extent, int);
310
312
316 virtual double GetScalarTypeMin(vtkInformation* meta_data);
317 virtual double GetScalarTypeMin();
318 virtual double GetScalarTypeMax(vtkInformation* meta_data);
319 virtual double GetScalarTypeMax();
321
323
326 virtual int GetScalarSize(vtkInformation* meta_data);
327 virtual int GetScalarSize();
329
331
343 virtual void GetIncrements(vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
344 virtual void GetIncrements(vtkIdType inc[3]);
346 virtual void GetIncrements(
347 vtkDataArray* scalars, vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
348 virtual void GetIncrements(vtkDataArray* scalars, vtkIdType inc[3]);
350
352
366 int extent[6], vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
368 vtkDataArray* scalars, int extent[6], vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
370
372
375 virtual void* GetScalarPointerForExtent(int extent[6]);
376 virtual void* GetScalarPointer(int coordinates[3]);
377 virtual void* GetScalarPointer(int x, int y, int z);
378 virtual void* GetScalarPointer();
380
382
385 virtual vtkIdType GetScalarIndexForExtent(int extent[6]);
386 virtual vtkIdType GetScalarIndex(int coordinates[3]);
387 virtual vtkIdType GetScalarIndex(int x, int y, int z);
389
391
394 virtual float GetScalarComponentAsFloat(int x, int y, int z, int component);
395 virtual void SetScalarComponentFromFloat(int x, int y, int z, int component, float v);
396 virtual double GetScalarComponentAsDouble(int x, int y, int z, int component);
397 virtual void SetScalarComponentFromDouble(int x, int y, int z, int component, double v);
399
405 virtual void AllocateScalars(int dataType, int numComponents);
406
413 virtual void AllocateScalars(vtkInformation* pipeline_info);
414
416
422 virtual void CopyAndCastFrom(vtkImageData* inData, int extent[6]);
423 virtual void CopyAndCastFrom(vtkImageData* inData, int x0, int x1, int y0, int y1, int z0, int z1)
424 {
425 int e[6];
426 e[0] = x0;
427 e[1] = x1;
428 e[2] = y0;
429 e[3] = y1;
430 e[4] = z0;
431 e[5] = z1;
432 this->CopyAndCastFrom(inData, e);
433 }
434
435
441 void Crop(const int* updateExtent) override;
442
451 unsigned long GetActualMemorySize() override;
452
454
458 vtkGetVector3Macro(Spacing, double);
459 virtual void SetSpacing(double i, double j, double k);
460 virtual void SetSpacing(const double ijk[3]);
462
464
472 vtkGetVector3Macro(Origin, double);
473 virtual void SetOrigin(double i, double j, double k);
474 virtual void SetOrigin(const double ijk[3]);
476
478
482 vtkGetObjectMacro(DirectionMatrix, vtkMatrix3x3);
484 virtual void SetDirectionMatrix(const double elements[9]);
485 virtual void SetDirectionMatrix(double e00, double e01, double e02, double e10, double e11,
486 double e12, double e20, double e21, double e22);
488
490
496
498
509
511
514 virtual void TransformContinuousIndexToPhysicalPoint(double i, double j, double k, double xyz[3]);
515 virtual void TransformContinuousIndexToPhysicalPoint(const double ijk[3], double xyz[3]);
516 virtual void TransformIndexToPhysicalPoint(int i, int j, int k, double xyz[3]);
517 virtual void TransformIndexToPhysicalPoint(const int ijk[3], double xyz[3]);
518 static void TransformContinuousIndexToPhysicalPoint(double i, double j, double k,
519 double const origin[3], double const spacing[3], double const direction[9], double xyz[3]);
521
523
529
531
542
544
547 virtual void TransformPhysicalPointToContinuousIndex(double x, double y, double z, double ijk[3]);
548 virtual void TransformPhysicalPointToContinuousIndex(const double xyz[3], double ijk[3]);
550
552
555 virtual void TransformPhysicalNormalToContinuousIndex(const double xyz[3], double ijk[3]);
557
562 virtual void TransformPhysicalPlaneToContinuousIndex(double const pplane[4], double iplane[4]);
563
565
569 double const origin[3], double const spacing[3], double const direction[9], double result[16]);
570
572
576 double const origin[3], double const spacing[3], double const direction[9], double result[16]);
578
579 static void SetScalarType(int, vtkInformation* meta_data);
580 static int GetScalarType(vtkInformation* meta_data);
581 static bool HasScalarType(vtkInformation* meta_data);
583 const char* GetScalarTypeAsString() { return vtkImageScalarTypeNameMacro(this->GetScalarType()); }
584
586
590 static void SetNumberOfScalarComponents(int n, vtkInformation* meta_data);
595
600 void CopyInformationFromPipeline(vtkInformation* information) override;
601
607 void CopyInformationToPipeline(vtkInformation* information) override;
608
614 void PrepareForNewData() override;
615
617
620 void ShallowCopy(vtkDataObject* src) override;
621 void DeepCopy(vtkDataObject* src) override;
623
624 //--------------------------------------------------------------------------
625 // Methods that apply to any array (not just scalars).
626 // I am starting to experiment with generalizing imaging filters
627 // to operate on more than just scalars.
628
630
635 void* GetArrayPointerForExtent(vtkDataArray* array, int extent[6]);
636 void* GetArrayPointer(vtkDataArray* array, int coordinates[3]);
638
640
647 vtkIdType GetTupleIndex(vtkDataArray* array, int coordinates[3]);
649
654 void GetArrayIncrements(vtkDataArray* array, vtkIdType increments[3]);
655
662 void ComputeInternalExtent(int* intExt, int* tgtExt, int* bnds);
663
667 int GetExtentType() VTK_FUTURE_CONST override { return VTK_3D_EXTENT; }
668
670
676
677protected:
679 ~vtkImageData() override;
680
681 // The extent of what is currently in the structured grid.
682 // Dimensions is just an array to return a value.
683 // Its contents are out of data until GetDimensions is called.
686
687 // Variables used to define dataset physical orientation
688 double Origin[3];
689 double Spacing[3];
693
694 int Extent[6];
695
699
700 // The first method assumes Active Scalars
701 void ComputeIncrements();
702 // This one is given the number of components of the
703 // scalar field explicitly
704 void ComputeIncrements(int numberOfComponents);
705 void ComputeIncrements(vtkDataArray* scalars);
706
707 // The first method assumes Active Scalars
709 // This one is given the number of components of the
710 // scalar field explicitly
711 void ComputeIncrements(int numberOfComponents, vtkIdType inc[3]);
713
714 // for the index to physical methods
716
721
722private:
723 void InternalImageDataCopy(vtkImageData* src);
724
725 friend class vtkUniformGrid;
726
727 // for the GetPoint method
728 double Point[3];
729
730 int DataDescription;
731 bool DirectionMatrixIsIdentity;
732
733 vtkImageData(const vtkImageData&) = delete;
734 void operator=(const vtkImageData&) = delete;
735};
736
737//----------------------------------------------------------------------------
739{
740 this->ComputeIncrements(this->Increments);
741}
742
743//----------------------------------------------------------------------------
744inline void vtkImageData::ComputeIncrements(int numberOfComponents)
745{
746 this->ComputeIncrements(numberOfComponents, this->Increments);
747}
748
749//----------------------------------------------------------------------------
751{
752 this->ComputeIncrements(scalars, this->Increments);
753}
754
755//----------------------------------------------------------------------------
757{
758 this->GetPoint(id, this->Point);
759 return this->Point;
760}
761
762//----------------------------------------------------------------------------
767
768//----------------------------------------------------------------------------
773
774//----------------------------------------------------------------------------
776{
777 return vtkStructuredData::GetDataDimension(this->DataDescription);
778}
779
780//----------------------------------------------------------------------------
782{
783 return vtkStructuredData::GetDataDimension(this->DataDescription);
784}
785
786//----------------------------------------------------------------------------
788{
789 return vtkStructuredData::GetDataDimension(this->DataDescription);
790}
791VTK_ABI_NAMESPACE_END
792#endif
abstract class to specify cell behavior
Definition vtkCell.h:51
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
virtual vtkIdType GetNumberOfCells()=0
Determine the number of cells composing the dataset.
virtual int GetMaxSpatialDimension()
Get the maximum/minimum spatial dimensionality of the data which is the maximum/minimum dimension of ...
virtual double * GetPoint(vtkIdType ptId)=0
Get point coordinates with ptId such that: 0 <= ptId < NumberOfPoints.
virtual int GetMinSpatialDimension()
Get the maximum/minimum spatial dimensionality of the data which is the maximum/minimum dimension of ...
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition vtkDataSet.h:243
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:24
void Crop(const int *updateExtent) override
Reallocates and copies to set the Extent to updateExtent.
int GetExtentType() VTK_FUTURE_CONST override
The extent type is a 3D extent.
virtual void TransformPhysicalPointToContinuousIndex(const double xyz[3], double ijk[3])
Convert coordinates from physical space (xyz) to index space (ijk).
virtual int GetDataDimension()
Return the dimensionality of the data.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
virtual vtkIdType * GetIncrements()
Different ways to get the increments for moving around the data.
void GetArrayIncrements(vtkDataArray *array, vtkIdType increments[3])
Since various arrays have different number of components, the will have different increments.
int GetDataObjectType() VTK_FUTURE_CONST override
Return what type of dataset this is.
virtual void TransformContinuousIndexToPhysicalPoint(const double ijk[3], double xyz[3])
Convert coordinates from index space (ijk) to physical space (xyz).
void CopyInformationToPipeline(vtkInformation *information) override
Copy information from this data object to the pipeline information.
vtkPoints * GetPoints() override
Standard vtkDataSet API methods.
vtkIdType GetCellSize(vtkIdType cellId) override
Standard vtkDataSet API methods.
vtkSmartPointer< vtkPoints > StructuredPoints
virtual void UnBlankCell(int i, int j, int k)
Methods for supporting blanking of cells.
void GetCellPoints(vtkIdType cellId, vtkIdType &npts, vtkIdType const *&pts, vtkIdList *ptIds) override
Standard vtkDataSet API methods.
int GetMinSpatialDimension() override
Standard vtkDataSet API methods.
virtual void CopyAndCastFrom(vtkImageData *inData, int extent[6])
This method is passed a input and output region, and executes the filter algorithm to fill the output...
virtual void UnBlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
bool HasAnyBlankCells() override
Returns 1 if there is any visibility constraint on the cells, 0 otherwise.
virtual vtkIdType ComputePointId(int ijk[3])
Given a location in structured coordinates (i-j-k), return the point id.
void BuildImplicitStructures()
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds) override
Standard vtkDataSet API methods.
friend class vtkUniformGrid
virtual void SetDirectionMatrix(vtkMatrix3x3 *m)
Set/Get the direction transform of the dataset.
virtual float GetScalarComponentAsFloat(int x, int y, int z, int component)
For access to data from wrappers.
vtkStructuredCellArray * GetCells()
Return the image data connectivity array.
vtkMatrix4x4 * IndexToPhysicalMatrix
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
void ComputeInternalExtent(int *intExt, int *tgtExt, int *bnds)
Given how many pixel are required on a side for boundary conditions (in bnds), the target extent to t...
virtual void SetDimensions(int i, int j, int k)
Same as SetExtent(0, i-1, 0, j-1, 0, k-1).
virtual double GetScalarTypeMin()
These returns the minimum and maximum values the ScalarType can hold without overflowing.
virtual void SetDirectionMatrix(const double elements[9])
Set/Get the direction transform of the dataset.
void ComputeIncrements()
void BuildPoints()
vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
static vtkImageData * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
virtual void TransformIndexToPhysicalPoint(const int ijk[3], double xyz[3])
Convert coordinates from index space (ijk) to physical space (xyz).
static int GetScalarType(vtkInformation *meta_data)
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds, int *seedLoc)
Get cell neighbors around cell located at seedloc, except cell of id cellId.
void ComputeBounds() override
Standard vtkDataSet API methods.
double * GetPoint(vtkIdType ptId) override
Standard vtkDataSet API methods.
void * GetArrayPointerForExtent(vtkDataArray *array, int extent[6])
These are convenience methods for getting a pointer from any filed array.
int Dimensions[3]
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
void BuildCellTypes()
static vtkImageData * ExtendedNew()
virtual double GetScalarTypeMin(vtkInformation *meta_data)
These returns the minimum and maximum values the ScalarType can hold without overflowing.
void GetCellBounds(vtkIdType cellId, double bounds[6]) override
Standard vtkDataSet API methods.
virtual void TransformPhysicalNormalToContinuousIndex(const double xyz[3], double ijk[3])
Convert normal from physical space (xyz) to index space (ijk).
void GetPoint(vtkIdType id, double x[3]) override
Standard vtkDataSet API methods.
void GetCellDims(int cellDims[3])
Given the node dimensions of this grid instance, this method computes the node dimensions.
virtual int GetScalarSize(vtkInformation *meta_data)
Get the size of the scalar type in bytes.
virtual void SetExtent(int extent[6])
Set/Get the extent.
static int GetNumberOfScalarComponents(vtkInformation *meta_data)
Set/Get the number of scalar components for points.
virtual void TransformPhysicalPlaneToContinuousIndex(double const pplane[4], double iplane[4])
Convert a plane from physical to a continuous index.
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Standard vtkDataSet API methods.
virtual void GetVoxelGradient(int i, int j, int k, vtkDataArray *s, vtkDataArray *g)
Given structured coordinates (i,j,k) for a voxel cell, compute the eight gradient values for the voxe...
int GetMaxSpatialDimension() override
Standard vtkDataSet API methods.
virtual double GetScalarTypeMax(vtkInformation *meta_data)
These returns the minimum and maximum values the ScalarType can hold without overflowing.
static vtkImageData * New()
vtkIdType GetTupleIndex(vtkDataArray *array, int coordinates[3])
Given a data array and a coordinate, return the index of the tuple in the array corresponding to that...
void ComputeIncrements(int numberOfComponents, vtkIdType inc[3])
int GetNumberOfScalarComponents()
Set/Get the number of scalar components for points.
vtkConstantArray< int > * GetCellTypesArray()
Get the array of all cell types in the image data.
vtkIdType GetNumberOfPoints() override
Standard vtkDataSet API methods.
virtual vtkIdType GetScalarIndex(int coordinates[3])
Access the index for the scalar data.
vtkSmartPointer< vtkStructuredCellArray > StructuredCells
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
static void ComputePhysicalToIndexMatrix(double const origin[3], double const spacing[3], double const direction[9], double result[16])
Static method to compute the PhysicalToIndexMatrix.
void ComputeIncrements(vtkDataArray *scalars, vtkIdType inc[3])
virtual void GetAxisUpdateExtent(int axis, int &min, int &max, const int *updateExtent)
Set / Get the extent on just one axis.
void * GetArrayPointer(vtkDataArray *array, int coordinates[3])
These are convenience methods for getting a pointer from any filed array.
virtual void AllocateScalars(int dataType, int numComponents)
Allocate the point scalars for this dataset.
virtual void BlankPoint(int i, int j, int k)
Methods for supporting blanking of cells.
virtual void SetScalarComponentFromFloat(int x, int y, int z, int component, float v)
For access to data from wrappers.
virtual int ComputeStructuredCoordinates(const double x[3], int ijk[3], double pcoords[3])
Convenience function computes the structured coordinates for a point x[3].
virtual void SetSpacing(double i, double j, double k)
Set the spacing (width,height,length) of the cubical cells that compose the data set.
static void SetNumberOfScalarComponents(int n, vtkInformation *meta_data)
Set/Get the number of scalar components for points.
virtual void SetDirectionMatrix(double e00, double e01, double e02, double e10, double e11, double e12, double e20, double e21, double e22)
Set/Get the direction transform of the dataset.
vtkIdType Increments[3]
int GetCellType(vtkIdType cellId) override
Standard vtkDataSet API methods.
void ApplyIndexToPhysicalMatrix(vtkMatrix4x4 *source)
Set the transformation matrix from the index space to the physical space coordinate system of the dat...
virtual void SetSpacing(const double ijk[3])
Set the spacing (width,height,length) of the cubical cells that compose the data set.
static void SetScalarType(int, vtkInformation *meta_data)
vtkIdType GetNumberOfCells() override
Standard vtkDataSet API methods.
virtual void SetOrigin(const double ijk[3])
Set/Get the origin of the dataset.
virtual void GetContinuousIncrements(int extent[6], vtkIdType &incX, vtkIdType &incY, vtkIdType &incZ)
Different ways to get the increments for moving around the data.
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
virtual int GetScalarSize()
Get the size of the scalar type in bytes.
virtual void UnBlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
int GetScalarType()
virtual void TransformPhysicalPointToContinuousIndex(double x, double y, double z, double ijk[3])
Convert coordinates from physical space (xyz) to index space (ijk).
const char * GetScalarTypeAsString()
void CopyInformationFromPipeline(vtkInformation *information) override
Override these to handle origin, spacing, scalar type, and scalar number of components.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual double GetScalarComponentAsDouble(int x, int y, int z, int component)
For access to data from wrappers.
static void TransformContinuousIndexToPhysicalPoint(double i, double j, double k, double const origin[3], double const spacing[3], double const direction[9], double xyz[3])
Convert coordinates from index space (ijk) to physical space (xyz).
virtual vtkIdType GetScalarIndexForExtent(int extent[6])
Access the index for the scalar data.
void ComputeIncrements(vtkIdType inc[3])
double Spacing[3]
void ApplyPhysicalToIndexMatrix(vtkMatrix4x4 *source)
Get the transformation matrix from the physical space to the index space coordinate system of the dat...
void ComputeTransforms()
vtkMatrix3x3 * DirectionMatrix
vtkIdType FindPoint(double x[3]) override
Standard vtkDataSet API methods.
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Standard vtkDataSet API methods.
double Origin[3]
void Initialize() override
Restore object to initial state.
virtual void BlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
static void ComputeIndexToPhysicalMatrix(double const origin[3], double const spacing[3], double const direction[9], double result[16])
Static method to compute the IndexToPhysicalMatrix.
virtual void UnBlankPoint(int i, int j, int k)
Methods for supporting blanking of cells.
virtual void SetScalarComponentFromDouble(int x, int y, int z, int component, double v)
For access to data from wrappers.
virtual void TransformContinuousIndexToPhysicalPoint(double i, double j, double k, double xyz[3])
Convert coordinates from index space (ijk) to physical space (xyz).
virtual void SetOrigin(double i, double j, double k)
Set/Get the origin of the dataset.
virtual void * GetScalarPointer(int coordinates[3])
Access the native pointer for the scalar data.
virtual double GetScalarTypeMax()
These returns the minimum and maximum values the ScalarType can hold without overflowing.
virtual void * GetScalarPointerForExtent(int extent[6])
Access the native pointer for the scalar data.
virtual void TransformIndexToPhysicalPoint(int i, int j, int k, double xyz[3])
Convert coordinates from index space (ijk) to physical space (xyz).
int GetMaxCellSize() override
Standard vtkDataSet API methods.
unsigned char IsPointVisible(vtkIdType ptId)
Return non-zero value if specified point is visible.
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Standard vtkDataSet API methods.
virtual void BlankCell(int i, int j, int k)
Methods for supporting blanking of cells.
vtkSmartPointer< vtkConstantArray< int > > StructuredCellTypes
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkCell * GetCell(int i, int j, int k) override
Standard vtkDataSet API methods.
virtual void SetAxisUpdateExtent(int axis, int min, int max, const int *updateExtent, int *axisUpdateExtent)
Set / Get the extent on just one axis.
static bool HasNumberOfScalarComponents(vtkInformation *meta_data)
Set/Get the number of scalar components for points.
static bool HasScalarType(vtkInformation *meta_data)
virtual void GetPointGradient(int i, int j, int k, vtkDataArray *s, double g[3])
Given structured coordinates (i,j,k) for a point in a structured point dataset, compute the gradient ...
~vtkImageData() override
unsigned char IsCellVisible(vtkIdType cellId)
Return non-zero value if specified point is visible.
void PrepareForNewData() override
make the output data ready for new data to be inserted.
virtual void BlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
virtual void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2)
Set/Get the extent.
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input image data object.
bool HasAnyBlankPoints() override
Returns 1 if there is any visibility constraint on the points, 0 otherwise.
virtual void SetDimensions(const int dims[3])
Same as SetExtent(0, dims[0]-1, 0, dims[1]-1, 0, dims[2]-1).
void BuildCells()
virtual int ComputeStructuredCoordinates(const double x[3], int ijk[3], double pcoords[3], double tol2)
Convenience function computes the structured coordinates for a point x[3].
vtkMatrix4x4 * PhysicalToIndexMatrix
virtual vtkIdType ComputeCellId(int ijk[3])
Given a location in structured coordinates (i-j-k), return the cell id.
static vtkImageData * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition vtkLine.h:23
represent and manipulate 3x3 transformation matrices
represent and manipulate 4x4 transformation matrices
a cell that represents an orthogonal quadrilateral
Definition vtkPixel.h:27
represent and manipulate 3D points
Definition vtkPoints.h:30
Hold a reference to a vtkObjectBase instance.
implicit object to represent cell connectivity
static vtkIdType ComputePointIdForExtent(const int extent[6], const int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the extent of the structured dataset,...
static vtkIdType GetNumberOfCells(const int ext[6], int dataDescription=VTK_EMPTY)
Given the grid extent, this method returns the total number of cells within the extent.
static int GetDataDimension(int dataDescription)
Return the topological dimension of the data (e.g., 0, 1, 2, or 3D).
static vtkIdType ComputeCellIdForExtent(const int extent[6], const int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the extent of the structured dataset,...
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, VTK_FUTURE_CONST int dim[3])
Get the cells using a point.
static vtkIdType GetNumberOfPoints(const int ext[6], int dataDescription=VTK_EMPTY)
Given the grid extent, this method returns the total number of points within the extent.
a cell that represents a 3D point
Definition vtkVertex.h:23
a cell that represents a 3D orthogonal parallelepiped
Definition vtkVoxel.h:31
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define vtkDataArray
vtkImplicitArray< vtkConstantImplicitBackend< T > > vtkConstantArray
A utility alias for wrapping constant functions in implicit arrays.
#define VTK_3D_EXTENT
int vtkIdType
Definition vtkType.h:332
@ VTK_IMAGE_DATA
Definition vtkType.h:82
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO
#define max(a, b)