------------------------------------------------------------------------------
| 149 | |
| 150 | //------------------------------------------------------------------------------ |
| 151 | vtkTypeInt64 vtkImageReader::ComputeStartOffset(int dataExtent[6], int idx) |
| 152 | { |
| 153 | vtkTypeInt64 startOffset; |
| 154 | |
| 155 | // convert data extent into constants that can be used to seek. |
| 156 | startOffset = |
| 157 | static_cast<std::streamoff>(dataExtent[0] - this->DataExtent[0]) * this->DataIncrements[0]; |
| 158 | |
| 159 | if (this->FileLowerLeft) |
| 160 | { |
| 161 | startOffset += |
| 162 | static_cast<std::streamoff>(dataExtent[2] - this->DataExtent[2]) * this->DataIncrements[1]; |
| 163 | } |
| 164 | else |
| 165 | { |
| 166 | startOffset += |
| 167 | static_cast<std::streamoff>(this->DataExtent[3] - this->DataExtent[2] - dataExtent[2]) * |
| 168 | this->DataIncrements[1]; |
| 169 | } |
| 170 | |
| 171 | // handle three and four dimensional files |
| 172 | if (this->GetFileDimensionality() >= 3) |
| 173 | { |
| 174 | startOffset += |
| 175 | static_cast<std::streamoff>(dataExtent[4] - this->DataExtent[4]) * this->DataIncrements[2]; |
| 176 | } |
| 177 | |
| 178 | startOffset += this->GetHeaderSize(idx); |
| 179 | |
| 180 | return startOffset; |
| 181 | } |
| 182 | |
| 183 | //------------------------------------------------------------------------------ |
| 184 | // This function reads in one data of data. |
no test coverage detected