-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] ENH,MAINT: Porting MNE Scan source plugins to MNE Analyze #901
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #901 +/- ##
==========================================
+ Coverage 30.20% 36.18% +5.98%
==========================================
Files 452 198 -254
Lines 39208 11812 -27396
==========================================
- Hits 11841 4274 -7567
+ Misses 27367 7538 -19829
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments :)
/** | ||
* ForwardSolution Plugin | ||
* | ||
* @brief The forwardsolution class provides a plugin for computing averages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong docu
MatrixXd matDataResized; | ||
matDataResized.resize(iNumberChannels, data.cols()); | ||
|
||
for(int j = 0; j < iNumberChannels; ++j) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about using more range based loops?
for(const auto& chName: lChNamesInvOp)
matDataResized.row(j) = data.row(lChNamesFiffInfo.indexOf(chName));
* | ||
* @param[in] parent The parent index. | ||
*/ | ||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a general comment: In cases of classes which are final in their inheritance scheme, I would only keep the override keyword and remove the virtual keyword.
I do not think that ForwardSolutionModel will be used as a base class. Maybe consider marking the whole class as final.
, m_bBusy(false) | ||
, m_bDoRecomputation(false) | ||
, m_bDoClustering(true) | ||
, m_bDoFwdComputation(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using in-class member initialisation instead of using the default constructor. The following core guideline is related. Your case does not 100% match the guideline example since you actually do something other than initialising members. Still I think it would make it more apparent to the reader of the class what the default values are.
|
||
//============================================================================================================= | ||
|
||
void ForwardSolution::init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to avoid two phase initialisation -> https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#nr5-dont-use-two-phase-initialization
I know I probably introduced this a long time ago ;)
|
||
void SourceLocalization::onModelRemoved(QSharedPointer<ANSHAREDLIB::AbstractModel> pRemovedModel) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q_UNUSED(pRemovedModel)
//============================================================================================================= | ||
|
||
FIFFLIB::FiffCov SourceLocalization::estimateCovariance(const Eigen::MatrixXd& matData, | ||
FIFFLIB::FiffInfo* info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we maybe pass info
as a const reference instead of a raw pointer?
computedCov.data = finalResult.matData; | ||
|
||
QStringList exclude; | ||
for(int i = 0; i<info->chs.size(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A range based loop would improve readability IMO
for(const auto& ch : info->chs)
if(ch.kind != FIFFV_MEG_CH && ch.kind != FIFFV_EEG_CH) {
exclude << ch.ch_name;
|
||
void FwdSettingsView::showMeasFileDialog() | ||
{ | ||
QString t_sFileName = QFileDialog::getOpenFileName(this, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t_sFileName
can be const
|
||
void FwdSettingsView::showSourceFileDialog() | ||
{ | ||
QString t_sFileName = QFileDialog::getOpenFileName(this, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be const. Check code below as well.
Porting:
Adding MNE Analyze Data Models:
Display:
Debugging: