MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
291 stars 179 forks source link

mrview -intensity_range and other options: apply to all supplied images? #456

Open thijsdhollander opened 8 years ago

thijsdhollander commented 8 years ago

So I wanted to investigate a large number (more than 200...) of images that all have a similar contrast using mrview (over our network). Good thing mrview has the snappyness to allow for this! But I also wanted the intensity range to be the same for all of them. Hence, I resorted to the -intensity_range option. Only to find out that option then only applies to the first image. :cry:

So question being: doesn't it make more sense to have this, and some similar, options of mrview being applied to all supplied images? Or to at least have an option to allow to do this?

maxpietsch commented 8 years ago

How about a checkbox in the view toolbox to lock the intensity scaling? That way one can manually set the windowing and then freeze it.

What other options do you have in mind that need to be applied to multiple images? I find myself often looking at one image and using multiple -overlay.load or -roi.load. Something like -overlay.multi_load overlay*.mif or -roi.multi_load roi*.mif would be handy but not sure how to implement that without breaking the argument parsing (multiple images).

On a related note: Overlays and main image have different intensity windowing when I use the same image.

jdtournier commented 8 years ago

Yes, I've been thinking about exactly this for a while. The tickbox to lock the scaling across images is what I had in mind. Although it wouldn't be locked as such, just applied universally across images - you'd still be able to change it as currently.

On a related note: Overlays and main image have different intensity windowing when I use the same image.

Yes, that would be due to the way the overlay is loaded: always as a full 3D texture. That sets the min/max values used for the scaling. The main image would by default be loaded as a single slice, so the min/max values used are relevant only for that slice. I'm not sure how to get around that - or even whether it needs fixing...?

maxpietsch commented 8 years ago

Although it wouldn't be locked as such, just applied universally across images - you'd still be able to change it as currently.

Adobe Photoshop Lightroom calls this "sync" which I think is a better name than "lock". (There you select multiple images by shift click and then synchronise adjustments from the current image either on the fly ("auto sync") or the current state of various parameters ("sync...").)

I'm not sure how to get around that - or even whether it needs fixing...?

I don't feel that needs to be changed. Just wondered whether that was a bug.

thijsdhollander commented 8 years ago

Yep, a checkbox with a "sync" functionality for the intensity range would definitely do the trick.

About the command line options to mrview: I reckon it would still feel weird to type, e.g.,

mrview */afd.mif -intensity_range 0,1

...but only see it applied to the first image. It sort of defeats (some of) the purpose of being able to load a large number of images at once, yet not apply certain options (optionally) universally. The specific advantage of not using the overlay is exactly the fact that those are loaded as full 3D textures. That would be quite a pain over the network, and probably explode my memory at some point... :worried:

Some other options I can think of that might fit this "category" are -interpolation_on, -interpolation_off, -colourmap.

jdtournier commented 8 years ago

So this is going to be really tricky with the current implementation. The way the command line parsing is done is that each option is applied directly as if the corresponding action had been performed on the GUI. Since setting the intensity range on the GUI would only affect the image currently displayed, it will also only affect the first image on the command line.

I think the simplest approach is that sync tick-box, which you could then also provide a command-line option for.

And yes, there's a lot of candidates for the sync feature. Volume is one I'd quite like to sync across images...

jdtournier commented 8 years ago

Oops, sorry...

jdtournier commented 8 years ago

By the way, the sync feature is essentially the same UI as necessary for the sync across instances feature that we've been discussing lately (issue #206, and to some extent #453). There would be more options for sync across instances, but I think it would make sense to use the same UI for both. Maybe all it needs to be is a sync menu entry in the top bar (with a nice icon), with checkable menu entries to sync across images in the same instance, or across instances, then a menu separator (i.e. horizontal line), followed by checkable menu entries for what to sync. So that would be a single menu with all the functionality in it, should be relatively easy to discover, yet unobtrusive.

Thoughts?

maxpietsch commented 8 years ago

I like the menu solution if we don't have too many options.

Candidates to sync for the main images: interpolation, colourmap, intensity scaling, thresholds, transparency, volume overlays: interpolation, colourmap, intensity scaling, thresholds, opacity ROIs: opacity

For overlay and ROI all these settings can already be synced on the fly if multiple images are highlighted in the list and the respective setting is changed. Maybe we could use a list of open images in the view toolbar to do the same for the main images?

Currently, for overlays and ROIs there is no way to bring all image properties to the same state without modifying each property individually. How about a "sync..." button that opens a popup window with checkboxes on what to sync (once or continuously) across main images, overlays (if any loaded), rois (if any loaded)?

Sync window ASCII art:

____________
| Sync once |
-------------
□ auto sync on change

main images:
  image1 (scrollable list of images, all selected by default)
  image2
  image3
 □ interpolation
 □ colourmap
 □ intensity scaling
 □ thresholds
 □ transparency
 □ volume
----------------------
overlay:  <- all of this could be a sync button in the overlay toolbar
 overlay1
 overlay2
 overlay3
 □ interpolation
 □ colourmap
 □ intensity scaling
 □ thresholds
 □ opacity
----------------------
ROI: <- not sure we need this 
 ROI1
 ROI2
 □ opacity
thijsdhollander commented 8 years ago

Aha, wasn't aware the command line options simply worked like that. It makes sense indeed to have a GUI-side interface for it then, and have a command line option to switch the syncing on; so inherently the syncable options are applied to everything when the option is supplied.

Actually, for overlays and ROIs, I wouldn't per se be bothered with it as much (as it might only clutter up the syncing menu/interface). As mentioned, there's already a way to modify properties for all of them (or even specific selections) as a whole. With the main images, it's just different in the sense that you always have to swap between them; i.e., there can only be a single "current" one.