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
294 stars 180 forks source link

Modify vector plot to display SH peaks and eigenvectors #65

Closed draffelt closed 9 years ago

Lestropie commented 10 years ago

So... basically... a more... 'generalized' orientation overlay? :-P

draffelt commented 10 years ago

Not unless you care to implement it. However it would be very simple to modify the current vector plot to load peaks.

Personally I can't see too many other users needing to visualise dixels. Tensors could be handled in a separate tool if you really want to display them.

I think flicking between separate ODF/Vector/Tensor tools using tabs is cleaner than having a single list of overlays with a separate popup toolbox associated with each item type.

Lestropie commented 10 years ago

Yeah, I think getting the generalized version to work (at least the way it is in my head) kind of relies on being able to change the contents of the tab, i.e. you have the file list and anything common between all overlays at the top of the tool bar, and the lower half of the same tool bar changes its contents to reflect the options available for the particular overlay currently selected.

But if, as you say, that actually can't be done with QT, then it may not be the cleanest option.

One extra option that will be needed for reading in XYZ vectors is a check box to flick between vectors being defined in real v.s. image space (i.e. FSL).

draffelt commented 10 years ago

You might be able to modify the contents of the current pane in QT, might be worth looking into. I recall looking into it when creating the track scalar tool, however maybe we went with the popup for other reasons (I can't recall sorry).

jdtournier commented 10 years ago

As far as I recall, the popup was mostly to prevent cluttering up the display needlessly when most people would rarely (if ever) use that particular functionality in the tractography tool... No issue with doing what you're talking about with Qt otherwise, it was purely a UI design decision.

Otherwise, I think adding support to read 'normal' vector images is the right way forward - it's simple and leverages existing code. The generalised orientation overlay idea sounds really complicated to get right and maintain... I'd personally rather have more tools that each do a specific job well, than a few one-size-fits-all tools that will probably end up being really messy to get right UI-wise. In this case, given our current definition of 'fixel', I think it makes sense that this tool would also be used to display orientations from a vector image.

Lestropie commented 10 years ago

I don't see that the generalized approach should be too much more complicated. One way of thinking about it is that we could generate individual tabs for ODF plotting, vector / fixel plotting, dixel plotting, tensor plotting... at some point, half of the available tool tabs would be regarding overlay of orientation information, which are never going to be used in parallel. So you make a new tab that handles plotting any kind of orientation information. The ideas in my head were essentially jumping to that final point. But there's no reason why such tools can't be developed independently and we can then consider a combination process later.

For instance, just incorporating loading XYZ direction images using the existing fixel overlay tool (even though these are the most similar overlay types) is going to cause UI issues; the fixel overlay has options (e.g. 'colour by') that are invalid for purely XYZ data. So you end up with options in the UI that either don't work or have to be disabled for certain input images.

draffelt commented 10 years ago

SH peaks and EV images have an amplitude and therefore the colour/length by value options will still be relevant.

If the user has a unit vector image for some reason, then I'm ok with it rendering with the max colour bar value.

Lestropie commented 10 years ago

You could take the norm of each vector at read time before normalising the vectors and use that to allow length by amplitude & colour by amplitude, but it's not strictly equivalent to the 'colour by value' we currently have. You could redundantly write this amplitude into the metric value associated with each fixel, but then you have two options that behave identically to one another (e.g. with the current UI options, 'line length by value' will do nothing).

I'm not trying to shoot the whole idea down, go for it absolutely. I'm trying to highlight how you're going to run into the kind of issues that my generalized orientation overlay, where only options relevant for the particular file currently loaded are displayed, is intended to solve.

draffelt commented 10 years ago

My plan was to do exactly that. Load the normalised vectors into the directions GPU buffer, and the norm of the vectors (i.e. the peak AFD or eigenvalues) into the value buffer. I don't quite understand why this is an issue? Colour/threshold/length by value will work exactly as it does for Fixel images.

Lestropie commented 10 years ago

It's not an 'issue', it's just redundant. E.g. length by amplitude & length by value will be one and the same. Thresholds will apply to fixel amplitudes where they would normally be applied to associated metric values (i.e. the amplitude is the value). What I mean is, if fixel images didn't exist and you were designing a overlay tool from scratch for XYZ images, some of those options wouldn't exist or would be designed slightly differently. So there's more scope for user confusion.

I agree it's not worth the effort of having a separate tool bar to distinguish between fixel and XYZ input images as there's so much overlap in functionality; that's not what I'm arguing for. The point is that depending on the type of orientation information that you're looking at, some functionalities are common, and some are not.

draffelt commented 10 years ago

Sorry I didn't click that you were talking about both the amplitude and value members of the FixelMetric class in the display.

Not sure if you have played around with it yet, but currently the Vector Plot tool only uses the value field in the FixelMetric class. This is for both colouring and length.

Personally I think it's cleaner if the viewer supports only a single scalar in the FixelMetric class. As I said in my recent Gitlab comment, if you want to view multiple scalars then you can always load up multiple images and flick between them.

Lestropie commented 10 years ago

OK, I'd looked at the tool itself but hadn't played. I had intended at some point to add options so that you could scale length by unary (i.e. all fixed length) / amplitude / value, colour by direction / amplitude / value, and threshold by amplitude / value. From the very get-go I made sure to include the amplitude in the FixelMetric class so that it would be included in all output images, precisely for this purpose.

jdtournier commented 10 years ago

OK, just a couple of things:

Lestropie commented 10 years ago
jdtournier commented 10 years ago

OK, I think we're not going to reach a consensus here...

I think the best course of action right now is for Dave to add the option of loading non-sparse direction data, since it should be pretty quick & straightforward and will already give us all the functionality we need. In the meantime, the issue Rob opened for the generalised orientation overlay is still there, so we can carry on the discussion over there if need be.

Lestropie commented 10 years ago

Yeah. Displaying the non-sparse direction data using the fixel tool is fine by me for now. And realistically if I want to try the generalized tool down the track, it's going to be borrowing existing back-end code anyways.

Regarding the amplitude field, removing it at this point is going to cause more heartache than leaving it there; and we all agree that storage space is not an issue. So I'd rather it be left as-is rather than going through all that then demonstrating later that it's actually of use.

rtabbara commented 9 years ago

The Vector plot tool should now be able to open non-msf files.