Added command options for mrview:#961
Added command options for mrview:#961jdtournier merged 18 commits intoMRtrix3:tag_3.0_RC2from LeeReid1:master
Conversation
tractography.load (loads a track file) tractography.slab (slab thickness) tractography.tsf (uses a tsf file for track node colours) WARNING: tsf optional arguments do not appear to actually be optional due to pre-existing code enforcing 'optional' args (bug?).
… LeeReidCSIRO-master
|
Can confirm that Arguments can be declared optiona; but, as far as I know, there is no way of specifying an Argument to an Option as optional. So I'd suggest using separate options instead: Alternatively, it might make sense to implement optional arguments for options to keep the command line options a bit tidier. |
|
OK, had a quick look into this. I agree with @maxpietsch that it would be best to split off the different settings into different options. And it's indeed not possible to have optional arguments to options, otherwise a command like this can't be parsed correctly: $ command argument1 -option mandatory_argument optional_argument argument2 ...since Otherwise, I fixed up the indentation to use 2 white spaces rather than tabs - this is the standard we've settled on in MRtrix3. There might be a way to set your editor to do use this for this project. The main issue you were facing was the fact that no tractogram was selected when you want to load the TSF. This would be better fixed by ensuring that the Tractography::tractogram_open_slot() call actually selected the newly loaded tractograms. This should immediately fix that problem, and also ensure correct operation when you want to load a TSF file that doesn't correspond to the last tractogram in the list (we would eventually need to add an option to choose which tractogram is selected). I'm surprised that you'd need to manually invoke I won't have time to look into this a great deal more over the next few days, but if you're feeling motivated, hopefully the above will give you some inspiration... 😉 |
The way it is set up at the moment means that the TSF file applies to the previously stated tractography file provided. This means you can do the following to apply two different tsf files to two different tck files:
I.E. a.tsf is applied to a.tck, and b.tsf is applied to b.tck. Modifying
No idea! I was surprised too. Qt is foreign to me. Perhaps signals are suppressed by the class until things are drawn to screen or I made an error somewhere? Not critical at the moment.
Edited as suggested |
I fully agree that it would work as expected, certainly as things stand. But I do think the correct solution here would be to fix the behaviour when a tractogram is added and make sure it is also selected at that point. It would make sense when interacting with the tool directly anyway. The Overlay tool does this, so it's probably a good example of how to get it to work.
Of course, you're right. The Overlay tool splits the open slot from the actual method that opens the images, so that the latter can be used programmatically. Ultimately, that would probably be favoured solution... As to the issue with the update needed to be triggered manually, I can probably look into this when I have a minute (probably after the ISMRM though...). |
|
I beg your pardon, I see what you were saying now. I'll have a go at refactoring it in the next few days
…________________________________________
From: J-Donald Tournier [notifications@github.com]
Sent: Tuesday, April 11, 2017 11:04 PM
To: MRtrix3/mrtrix3
Cc: Reid, Lee (H&B, Herston - RBWH); Author
Subject: Re: [MRtrix3/mrtrix3] Added command options for mrview: (#961)
The way it is set up at the moment means that the TSF file applies to the previously stated tractography file provided.
I fully agree that it would work as expected, certainly as things stand. But I do think the correct solution here would be to fix the behaviour when a tractogram is added and make sure it is also selected at that point. It would make sense when interacting with the tool directly anyway. The Overlay tool does this, so it's probably a good example of how to get it to work.
Modifying Tractography::tractogram_open_slot will not affect the current behaviour because this method is not used (this slot launches an open file dialog).
Of course, you're right. The Overlay tool splits the open slot from the actual method that opens the images<https://github.com/MRtrix3/mrtrix3/blob/master/src/gui/mrview/tool/overlay.cpp#L198-L222>, so that the latter can be used programmatically. Ultimately, that would probably be favoured solution...
As to the issue with the update needed to be triggered manually, I can probably look into this when I have a minute (probably after the ISMRM though...).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#961 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AZv2FMxahqgLLTVwrts6IhrzMdsOjDn5ks5ru4F0gaJpZM4M4StR>.
|
… command line commands) to call a single method
|
Sorry for the delay. I've refactored the code as suggested. Opening a tractogram will now result in it being selected. There is a bug (in the current version of MRtrix), and I'm not whether I introduced it or not in my previous commit. To replicate:
The tractography file will load, but the side bar will not list the file until the window is resized. |
|
Worth highlighting that the clang build is failing due to some change in the Eigen 3 library, not my code.
Compiling with g++-6 works fine |
This header should no longer be included directly, since class MR::vector (defined in core/types.h) should always be used.
As discussed in #996. Also some other minor cosmetic changes.
|
@LeeReidCSIRO, I finally found a bit of time to look through your suggestions. I made the very minor edits required to get it to pass the Eigen compatibility tests (I've yet to document these changes, so it's no surprise that it would catch people out...). The other changes are basically purely cosmetic. Everything seems to work fine from my side. The issue you mentioned with the sidebar not updating after tractography load until a resize isn't a problem for me. What version of Qt are you using...? |
I can't reproduce this. Neither in our nor in LeeReidCSIRO's master branch. Loading a tractogram causes the toolbar to flicker so I think it gets updated. |
See discussion on #996
|
Qt 4.8.6 |
|
@maxpietsch I think if it's working for you here, chances are it's a bug that's a little deeper than my commits. |
|
Kerstin Pannek has just pointed the following: |
|
I've just had another quick go, I can't reproduce the issues you're reporting using either Qt 5.8.0 or Qt 4.8.7 (on Arch Linux). I have no idea why this might be happening. Could be an interaction with your window manager? We use Gnome Shell typically (or i3 for @maxpietsch...), maybe this is an issue specific to Unity...? |
|
Let's merge this into the |
|
That sounds good to me. |
|
OK, changed base branch to |
tractography.load (loads a track file)
tractography.slab (slab thickness, or -1 for unlimited)
tractography.tsf (uses a tsf file for track node colours)
WARNING: tsf optional arguments do not appear to actually be optional due to pre-existing code enforcing 'optional' args (bug?).
Edits work, but may require a slight tidy to match expected patterns etc. I've never touched QT before!