-
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
[Fix] Fix leak in test_coregistration and attends various warnings #849
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #849 +/- ##
==========================================
- Coverage 30.10% 30.08% -0.02%
==========================================
Files 452 452
Lines 39254 39253 -1
==========================================
- Hits 11816 11809 -7
- Misses 27438 27444 +6
|
// sourceEstimate, | ||
// t_clusteredFwd, | ||
// t_surfSet, | ||
// t_annotationSet); |
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.
Why are the last two addSourceData commented out?
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.
not used?
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.
pRTDataItem
might not be used but the data should still be added to p3DDataModel
. Maybe change to:
p3DDataModel->addSourceData(parser.value(subjectOption),
"HemiLRSet",
sourceEstimate,
t_clusteredFwd,
t_surfSet,
t_annotationSet);
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.
I only see one addSourceData commented out. Where do you see the second one?
P3DDataModel is also not used any more. And this is the end of the application. But you're right, you never know. That is why it is not deleted.
But well. After reading your comment. It is true that there is a chance that there is some sort of communication between p3DDataModel and p3DAbstractView that makes this call to addSourceData needed. I was probably just hoping that not to be the case.
Done.
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.
Maybe let me explain my point in a bit more detail. Ignore my comment about TWO addSourceData
. You are right there is only one. If you comment out the addSourceData
call, you will not add the computed source localisation result to the 3D view. That is the only problem I see. Regarding the return variable of addSourceData
pRTDataItem
, you can remove that one. It is not used in this example. But the call addSourceData
is actually needed to visualise the result in 3D. Hope this clarified my problem a bit?
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.
@LorenzE Thanks for the comment. I've modified accordingly and pushed changes.
3df69a7
to
d118b7c
Compare
@LorenzE Please review this whenever you can. |
t_clusteredFwd, | ||
t_surfSet, | ||
t_annotationSet); | ||
// MneDataTreeItem* pRTDataItem = p3DDataModel->addSourceData(parser.value(subjectOption), |
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.
If you comment out this call, the 3D view will be empty
@@ -227,7 +227,7 @@ int main(int argc, char *argv[]) | |||
AbstractView::SPtr p3DAbstractView = AbstractView::SPtr(new AbstractView()); | |||
Data3DTreeModel::SPtr p3DDataModel = p3DAbstractView->getTreeModel(); | |||
DigitizerSetTreeItem* pDigSrcSetTreeItem = p3DDataModel->addDigitizerData("Sample", "Fiducials Transformed", digSetSrc); | |||
DigitizerSetTreeItem* pDigHspSetTreeItem = p3DDataModel->addDigitizerData("Sample", "Digitizer", digSetHsp); | |||
// DigitizerSetTreeItem* pDigHspSetTreeItem = p3DDataModel->addDigitizerData("Sample", "Digitizer", digSetHsp); |
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.
Why don't you want to visualise Digitizer date?
* | ||
* @return clustered MNE forward solution. | ||
*/ | ||
MNEForwardSolution cluster_forward_solution(const FSLIB::AnnotationSet &p_AnnotationSet, |
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.
Why creating a new function instead of leaving the old one with the default parameters? Do you maybe have a good reference if this is best practice? Or is it just a personal preference?
No description provided.