13#include <AMReX_REAL.H>
14#include <AMReX_iMultiFab.H>
54 explicit DatReader(
const std::string& filename);
80 bool readFile(
const std::string& filename);
119 amrex::iMultiFab& mf)
const;
127 amrex::Box
box()
const;
154 const std::vector<DataType>&
getRawData()
const;
162 bool readDatFileInternal();
165 std::string m_filename;
166 std::vector<DataType> m_raw;
170 bool m_is_read =
false;
std::uint16_t DataType
Definition DatReader.H:37
DatReader(const DatReader &)=delete
int depth() const
Get depth (Z-dimension) of the dataset in pixels/voxels.
Definition DatReader.cpp:184
void threshold(DataType raw_threshold, amrex::iMultiFab &mf) const
Fills an iMultiFab based on thresholding the raw data.
Definition DatReader.cpp:270
int height() const
Get height (Y-dimension) of the dataset in pixels/voxels.
Definition DatReader.cpp:181
virtual ~DatReader()=default
Virtual default destructor.
DatReader & operator=(const DatReader &)=delete
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 i...
Definition DatReader.cpp:197
bool readFile(const std::string &filename)
Reads data from the specified filename into this object.
Definition DatReader.cpp:75
bool isRead() const
Checks if the reader has successfully read metadata and data.
Definition DatReader.cpp:71
amrex::Box box() const
Returns the index space Box covering the entire image domain. The Box typically starts at (0,...
Definition DatReader.cpp:187
int width() const
Get width (X-dimension) of the dataset in pixels/voxels.
Definition DatReader.cpp:178
const std::vector< DataType > & getRawData() const
Get read-only access to the entire raw data vector. Provides direct access but exposes internal stora...
Definition DatReader.cpp:193
DatReader()
Default constructor. Creates an empty reader. Use readFile() later.
Definition DatReader.cpp:57
Definition CathodeWrite.cpp:12