------------------------------------------------------------------------------
| 148 | |
| 149 | //------------------------------------------------------------------------------ |
| 150 | void vtkImageData::BuildPoints() |
| 151 | { |
| 152 | vtkNew<vtkDoubleArray> xCoords; |
| 153 | vtkNew<vtkDoubleArray> yCoords; |
| 154 | vtkNew<vtkDoubleArray> zCoords; |
| 155 | vtkDoubleArray* axisCoords[3] = { xCoords.Get(), yCoords.Get(), zCoords.Get() }; |
| 156 | |
| 157 | int dims[3]; |
| 158 | this->GetDimensions(dims); |
| 159 | |
| 160 | int extent[6]; |
| 161 | this->GetExtent(extent); |
| 162 | |
| 163 | int loc[3]; |
| 164 | int ijk[3]; |
| 165 | double point[3]; |
| 166 | for (int i = 0; i < 3; ++i) |
| 167 | { |
| 168 | if (this->DirectionMatrixIsIdentity) |
| 169 | { |
| 170 | axisCoords[i]->SetNumberOfValues(dims[i]); |
| 171 | for (loc[i] = 0, ijk[i] = extent[2 * i]; loc[i] < dims[i]; ++loc[i], ++ijk[i]) |
| 172 | { |
| 173 | point[i] = this->Origin[i] + this->Spacing[i] * ijk[i]; |
| 174 | axisCoords[i]->SetValue(loc[i], point[i]); |
| 175 | } |
| 176 | } |
| 177 | else |
| 178 | { |
| 179 | // axis coords will be used to extract spacing and origin, so we use loc instead of ijk |
| 180 | axisCoords[i]->SetNumberOfValues(2); |
| 181 | axisCoords[i]->SetValue(0, this->Origin[i]); |
| 182 | axisCoords[i]->SetValue(1, this->Origin[i] + this->Spacing[i]); |
| 183 | } |
| 184 | } |
| 185 | this->SetStructuredPoints(vtkStructuredData::GetPoints( |
| 186 | xCoords, yCoords, zCoords, extent, this->DirectionMatrix->GetData())); |
| 187 | } |
| 188 | |
| 189 | //------------------------------------------------------------------------------ |
| 190 | void vtkImageData::GetCell(vtkIdType cellId, vtkGenericCell* cell) |
no test coverage detected