[Fix] Fix leak in test_coregistration and attends various warnings#849
[Fix] Fix leak in test_coregistration and attends various warnings#849juangpc wants to merge 9 commits intomne-tools:mainfrom
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.
Why are the last two addSourceData commented out?
There was a problem hiding this comment.
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.
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.
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.
@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.
If you comment out this call, the 3D view will be empty
| 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.
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.
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.