|
| amrex::Box | box () const |
| | Returns the index space Box covering the entire image domain. The Box typically starts at (0,0,0).
|
| | DatReader () |
| | Default constructor. Creates an empty reader. Use readFile() later.
|
| | DatReader (const DatReader &)=delete |
| | DatReader (const std::string &filename) |
| | Constructs a DatReader and reads data from the specified filename.
|
| int | depth () const |
| | Get depth (Z-dimension) of the dataset in pixels/voxels.
|
| const std::vector< DataType > & | getRawData () const |
| | Get read-only access to the entire raw data vector. Provides direct access but exposes internal storage layout (XYZ order assumed).
|
| DataType | getRawValue (int i, int j, int k) const |
| | Get the raw data value at a specific coordinate. Performs bounds checking. Throws std::out_of_range if indices are invalid.
|
| int | height () const |
| | Get height (Y-dimension) of the dataset in pixels/voxels.
|
| bool | isRead () const |
| | Checks if the reader has successfully read metadata and data.
|
| DatReader & | operator= (const DatReader &)=delete |
| bool | readFile (const std::string &filename) |
| | Reads data from the specified filename into this object.
|
| void | threshold (DataType raw_threshold, amrex::iMultiFab &mf) const |
| | Fills an iMultiFab based on thresholding the raw data.
|
| void | threshold (DataType raw_threshold, int value_if_true, int value_if_false, amrex::iMultiFab &mf) const |
| | Fills an iMultiFab based on thresholding the raw data with custom output values.
|
| int | width () const |
| | Get width (X-dimension) of the dataset in pixels/voxels.
|
| virtual | ~DatReader ()=default |
| | Virtual default destructor.
|
Reads and provides access to raw image data from specific DAT files.
This class reads a binary DAT file (assumed format from Heidelberg context, details need verification), stores the raw voxel data, and provides methods to query dimensions and generate thresholded AMReX iMultiFabs.
- Warning
- The exact DAT file format (data type, endianness, header presence/format, data layout) is assumed and needs verification. This implementation assumes a specific raw binary layout. Endianness might need handling in readFile().
-
Copying is disabled due to potentially large raw data size.
| void OpenImpala::DatReader::threshold |
( |
DataType | raw_threshold, |
|
|
amrex::iMultiFab & | mf ) const |
Fills an iMultiFab based on thresholding the raw data.
Iterates through the cells of the iMultiFab 'mf'. For each cell (i,j,k), if the corresponding raw data value is greater than 'raw_threshold', sets mf(i,j,k) = 1, otherwise sets it to 0.
- Warning
- Caller must ensure mf's BoxArray is compatible with the dimensions read from the DAT file (available via box(), width(), etc.). Internal checks might be added in implementation for safety.
- Parameters
-
| raw_threshold | The threshold value (in raw data units). |
| mf | Output amrex::iMultiFab reference to fill (must be defined). |
| void OpenImpala::DatReader::threshold |
( |
DataType | raw_threshold, |
|
|
int | value_if_true, |
|
|
int | value_if_false, |
|
|
amrex::iMultiFab & | mf ) const |
Fills an iMultiFab based on thresholding the raw data with custom output values.
Iterates through the cells of the iMultiFab 'mf'. For each cell (i,j,k), if the corresponding raw data value is greater than 'raw_threshold', sets mf(i,j,k) = value_if_true, otherwise sets it to value_if_false.
- Warning
- Caller must ensure mf's BoxArray is compatible with the dimensions.
- Parameters
-
| raw_threshold | The threshold value (in raw data units). |
| value_if_true | The integer value to set if raw_data[idx] > raw_threshold. |
| value_if_false | The integer value to set otherwise. |
| mf | Output amrex::iMultiFab reference to fill (must be defined). |