61 QVector<MriSlice>& slices,
81 QString fileName = QString(
"%1/COR-%2").arg(dir).arg(k + 1, 3, 10, QChar(
'0'));
84 if (!file.open(QIODevice::ReadOnly)) {
85 qCritical() <<
"MriCorIO::read - Could not open COR file" << fileName;
89 QByteArray data = file.readAll();
92 if (data.size() < nPixels) {
93 qCritical() <<
"MriCorIO::read - COR file" << fileName <<
"is too small:"
94 << data.size() <<
"bytes (expected" << nPixels <<
")";
108 slice.
pixels.resize(nPixels);
109 memcpy(slice.
pixels.data(), data.constData(), nPixels);
116 rot << -1.0f, 0.0f, 0.0f,
120 Eigen::Vector3f move;
121 move << 0.128f, -0.128f +
static_cast<float>(k) / 1000.0f, 0.128f;
127 printf(
"Read %d COR slices from %s\n",
COR_NSLICE, qPrintable(dir));
Reader for the legacy FreeSurfer COR-NNN per-slice volume layout (256 unsigned-char coronal slices on...
return FiffCoordTrans(from_frame, to_frame, R, moveVec)
Symbolic FIFF tag, block, value, unit and channel-type constants shared across FIFFLIB.
#define FIFFV_COORD_MRI_SLICE
FIFF tag-kind, block-kind and type-code numerical definitions, authoritative for FIFFLIB.
#define FIFFV_MRI_PIXEL_BYTE
4x4 affine FIFF coordinate transform (FIFF_COORD_TRANS) annotated with source/destination coordinate-...
FIFF file I/O, in-memory data structures and high-level readers/writers.
Volume I/O, voxel geometry and slice resampling for structural MRI data inside mne-cpp.
constexpr float COR_PIXEL_SIZE
static bool read(const QString &dir, QVector< MriSlice > &slices, bool verbose=false)
Single 2D MRI slice (pixels + slice→RAS transform) used as the volume's storage unit.
QVector< unsigned char > pixels
FIFFLIB::FiffCoordTrans trans