Collection of FiffDigPoint records as parsed from a FIFFB_ISOTRAK block. More...
#include <fiff_dig_point_set.h>
Public Types | |
| using | SPtr = QSharedPointer<FiffDigPointSet> |
| using | ConstSPtr = QSharedPointer<const FiffDigPointSet> |
| using | UPtr = std::unique_ptr<FiffDigPointSet> |
| using | ConstUPtr = std::unique_ptr<const FiffDigPointSet> |
Public Member Functions | |
| FiffDigPointSet () | |
| FiffDigPointSet (const FiffDigPointSet &p_FiffDigPointSet) | |
| FiffDigPointSet & | operator= (const FiffDigPointSet &other)=default |
| FiffDigPointSet (QList< FIFFLIB::FiffDigPoint > pointList) | |
| FiffDigPointSet (QIODevice &p_IODevice) | |
| ~FiffDigPointSet () | |
| void | clear () |
| bool | isEmpty () const |
| qint32 | size () const |
| bool | write (QIODevice &p_IODevice) |
| bool | write (const QString &filePath, QString *errorMessage=nullptr) |
| void | writeToStream (FiffStream *p_pStream) |
| const FiffDigPoint & | operator[] (qint32 idx) const |
| FiffDigPoint & | operator[] (qint32 idx) |
| FiffDigPointSet | pickTypes (QList< int > includeTypes) const |
| FiffDigPointSet & | operator<< (const FiffDigPoint &dig) |
| FiffDigPointSet & | operator<< (const FiffDigPoint *dig) |
| void | applyTransform (const FiffCoordTrans &coordTrans, bool bApplyInverse=false) |
| bool | transformToHead () |
| QList< FiffDigPoint > | getList () |
Static Public Member Functions | |
| static bool | readFromStream (FiffStream::SPtr &p_Stream, FiffDigPointSet &p_Dig) |
| static bool | readPolhemusIsotrak (const QString &path, FiffDigPointSet &dig, const QStringList &chNames=QStringList(), const QString &unit=QStringLiteral("m")) |
| static bool | readPolhemusFastscan (const QString &path, Eigen::MatrixX3d &points, const QString &unit=QStringLiteral("mm"), bool requireHeader=true) |
| static bool | readCaptrak (const QString &path, FiffDigPointSet &dig, QStringList *chNames=nullptr) |
| static bool | readEgi (const QString &path, FiffDigPointSet &dig, QStringList *chNames=nullptr) |
| static bool | readLocalite (const QString &path, FiffDigPointSet &dig, QStringList *chNames=nullptr, const QString &nasion=QString(), const QString &lpa=QString(), const QString &rpa=QString()) |
| static bool | readNeuroscanDat (const QString &path, FiffDigPointSet &dig, QStringList *chNames=nullptr) |
Collection of FiffDigPoint records as parsed from a FIFFB_ISOTRAK block.
Indexed access plus convenience filters (cardinals only, HPI only, EEG only, extras only) so registration code can pick out the subset it needs without re-walking the underlying QList of dig points.
Definition at line 82 of file fiff_dig_point_set.h.
| using FIFFLIB::FiffDigPointSet::ConstSPtr = QSharedPointer<const FiffDigPointSet> |
Const shared pointer type for FiffDigPointSet.
Definition at line 86 of file fiff_dig_point_set.h.
| using FIFFLIB::FiffDigPointSet::ConstUPtr = std::unique_ptr<const FiffDigPointSet> |
Const unique pointer type for FiffDigPointSet.
Definition at line 88 of file fiff_dig_point_set.h.
| using FIFFLIB::FiffDigPointSet::SPtr = QSharedPointer<FiffDigPointSet> |
Shared pointer type for FiffDigPointSet.
Definition at line 85 of file fiff_dig_point_set.h.
| using FIFFLIB::FiffDigPointSet::UPtr = std::unique_ptr<FiffDigPointSet> |
Unique pointer type for FiffDigPointSet.
Definition at line 87 of file fiff_dig_point_set.h.
| FiffDigPointSet::FiffDigPointSet | ( | ) |
Constructs a FiffDigPointSet object.
Definition at line 69 of file fiff_dig_point_set.cpp.
| FiffDigPointSet::FiffDigPointSet | ( | const FiffDigPointSet & | p_FiffDigPointSet | ) |
Copy constructor.
| [in] | p_FiffDigPointSet | FiffDigPointSet which should be copied. |
Definition at line 76 of file fiff_dig_point_set.cpp.
| FiffDigPointSet::FiffDigPointSet | ( | QList< FIFFLIB::FiffDigPoint > | pointList | ) |
Construct FiffDigPointSet based on input pointList
| [in] | pointList | list of digitizer points |
Definition at line 83 of file fiff_dig_point_set.cpp.
| FiffDigPointSet::FiffDigPointSet | ( | QIODevice & | p_IODevice | ) |
Constructs a FiffDigPointSet by reading from a IO device.
| [in] | p_IODevice | IO device to read the digitizer point set from. |
Definition at line 90 of file fiff_dig_point_set.cpp.
| FiffDigPointSet::~FiffDigPointSet | ( | ) |
Destroys the FiffDigPointSet
Definition at line 107 of file fiff_dig_point_set.cpp.
| void FiffDigPointSet::applyTransform | ( | const FiffCoordTrans & | coordTrans, |
| bool | bApplyInverse = false ) |
Apply a transformation matrix on the 3D position of the digitized points.
| [in] | coordTrans | FiffCoordTrans which is to be applied. |
| [in] | bApplyInverse | Whether to apply the inverse. False by default. |
Definition at line 720 of file fiff_dig_point_set.cpp.
|
inline |
Initializes FiffDigPointSet
Definition at line 400 of file fiff_dig_point_set.h.
| QList< FiffDigPoint > FiffDigPointSet::getList | ( | ) |
Returns list of digitizer point the set contains
Definition at line 770 of file fiff_dig_point_set.cpp.
|
inline |
True if FiffDigPointSet is empty.
Definition at line 407 of file fiff_dig_point_set.h.
| FiffDigPointSet & FiffDigPointSet::operator<< | ( | const FiffDigPoint & | dig | ) |
Subscript operator << to add a new FiffDigPoint
| [in] | dig | FiffDigPoint to be added. |
Definition at line 704 of file fiff_dig_point_set.cpp.
| FiffDigPointSet & FiffDigPointSet::operator<< | ( | const FiffDigPoint * | dig | ) |
Subscript operator << to add a new FiffDigPoint
| [in] | dig | FiffDigPoint to be added. |
Definition at line 712 of file fiff_dig_point_set.cpp.
|
default |
Copy assignment. Every member has value semantics, so the compiler-generated member-wise assignment is correct. It is declared explicitly because declaring a copy constructor and/or a destructor deprecates the implicitly generated one.
| [in] | other | Object to assign from. |
| FiffDigPoint & FiffDigPointSet::operator[] | ( | qint32 | idx | ) |
Subscript operator [] to access FiffDigPoint by index
| [in] | idx | the FiffDigPoint index. |
Definition at line 678 of file fiff_dig_point_set.cpp.
| const FiffDigPoint & FiffDigPointSet::operator[] | ( | qint32 | idx | ) | const |
Subscript operator [] to access FiffDigPoint by index
| [in] | idx | the FiffDigPoint index. |
Definition at line 667 of file fiff_dig_point_set.cpp.
| FiffDigPointSet FiffDigPointSet::pickTypes | ( | QList< int > | includeTypes | ) | const |
Pick the wanted types from this set and returns them
| [in] | includeTypes | The include types (FIFFV_POINT_HPI, FIFFV_POINT_CARDINAL, FIFFV_POINT_EEG, FIFFV_POINT_ECG, FIFFV_POINT_EXTRA, FIFFV_POINT_LPA, FIFFV_POINT_NASION, FIFFV_POINT_RPA). |
Definition at line 689 of file fiff_dig_point_set.cpp.
|
static |
Reads a BrainVision CapTrak .bvct file, as mne.channels.read_dig_captrak does.
The electrodes named Nasion, LPA and RPA become the cardinal points, every other electrode an EEG point; millimetres are converted to metres. The points are in digitizer coordinates (FIFFV_COORD_UNKNOWN), numbered as by readPolhemusIsotrak; a repeated name keeps its first place and its last position.
| [in] | path | The .bvct file. |
| [out] | dig | The digitizer points. |
| [out] | chNames | If not null, the electrode names in the order of the EEG points. |
Definition at line 440 of file fiff_dig_point_set.cpp.
|
static |
Reads the coordinates.xml of an EGI MFF recording, as mne.channels.read_dig_egi does.
Sensors of type 0 become EEG points named "EEG <number>", the reference (type 1) is numbered after the electrodes before it, and the nasion and periauricular points (type 2) become the cardinal points. Unlike mne.channels.read_dig_egi, which keeps the file's centimetres as if they were metres, the positions are converted to metres (as mne.io.read_raw_egi does).
| [in] | path | The coordinates.xml file. |
| [out] | dig | The digitizer points, in digitizer coordinates. |
| [out] | chNames | If not null, the electrode names in the order of the EEG points. |
Definition at line 469 of file fiff_dig_point_set.cpp.
|
static |
Reads FiffDigPointSet from a fif file
| [in,out] | p_Stream | The opened fif file. |
| [in,out] | p_Dig | The read digitizer point set. |
Definition at line 113 of file fiff_dig_point_set.cpp.
|
static |
Reads a Localite .csv file ("#,name,x,y,z" in millimetres after a header row), as mne.channels.read_dig_localite does.
| [in] | path | The .csv file. |
| [out] | dig | The digitizer points, in digitizer coordinates. |
| [out] | chNames | If not null, the electrode names in the order of the EEG points. |
| [in] | nasion | Name of the point that is the nasion, or empty. |
| [in] | lpa | Name of the point that is the left preauricular point, or empty. |
| [in] | rpa | Name of the point that is the right preauricular point, or empty. |
Definition at line 510 of file fiff_dig_point_set.cpp.
|
static |
Reads a Neuroscan .dat electrode file ("name number x y z" per line), as mne.channels.read_dig_dat does: point numbers 78, 76 and 82 are the nasion, LPA and RPA, 67 (the centroid) is skipped, and the coordinates are kept as they are.
| [in] | path | The .dat file. |
| [out] | dig | The digitizer points, in digitizer coordinates. |
| [out] | chNames | If not null, the electrode names in the order of the EEG points. |
Definition at line 557 of file fiff_dig_point_set.cpp.
|
static |
Reads the points of a Polhemus FastSCAN .txt file in metres, as mne.channels.read_polhemus_fastscan does.
| [in] | path | The .txt file. |
| [out] | points | The points, one per row, in digitizer coordinates. |
| [in] | unit | Unit of the file: "m", "cm" or "mm". |
| [in] | requireHeader | Reject files whose "%" header does not name FastSCAN. |
Definition at line 403 of file fiff_dig_point_set.cpp.
|
static |
Reads a Polhemus Isotrak digitizer file, as mne.channels.read_dig_polhemus_isotrak does.
The three fiducials become cardinal points (LPA, nasion, RPA). The remaining points become HPI coils for an .elp file and head shape points for .hsp/.eeg files, or EEG electrodes when chNames names them. Electrodes are numbered by the last three characters of their names when all of those are numbers, and 1..n otherwise. All points are in digitizer coordinates (FIFFV_COORD_UNKNOWN).
| [in] | path | The .elp, .hsp or .eeg file. |
| [out] | dig | The digitizer points. |
| [in] | chNames | Electrode names, one per non-fiducial point, or empty. |
| [in] | unit | Unit of the file: "m", "cm" or "mm". |
Definition at line 363 of file fiff_dig_point_set.cpp.
|
inline |
Returns the number of stored FiffDigPoints
Definition at line 414 of file fiff_dig_point_set.h.
| bool FiffDigPointSet::transformToHead | ( | ) |
Move every point that shares the frame of the LPA, nasion and RPA points into the Neuromag head frame defined by these fiducials (mne.channels.transform_to_head).
Definition at line 741 of file fiff_dig_point_set.cpp.
| bool FiffDigPointSet::write | ( | const QString & | filePath, |
| QString * | errorMessage = nullptr ) |
Convenience overload: write the digitizer point set to a path on disk.
Verifies that the destination directory exists and that the file was actually produced. The file is opened in WriteOnly|Truncate mode.
| [in] | filePath | Destination .fif file path. |
| [out] | errorMessage | Optional, populated on failure. |
Definition at line 608 of file fiff_dig_point_set.cpp.
| bool FiffDigPointSet::write | ( | QIODevice & | p_IODevice | ) |
Writes the FiffDigPointSet to a FIFF file.
| [in] | p_IODevice | IO device to write the digitizer point set to. |
Definition at line 594 of file fiff_dig_point_set.cpp.
| void FiffDigPointSet::writeToStream | ( | FiffStream * | p_pStream | ) |
Writes the FiffDigPointSet to a FIFF stream.
| [in] | p_pStream | Pointer to the FIFF stream to write to. |
Definition at line 649 of file fiff_dig_point_set.cpp.