Skip to content
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

WIP: Volume Source Estimate Visualization #672

Closed
wants to merge 1 commit into from

Conversation

mluessi
Copy link
Contributor

@mluessi mluessi commented Jun 27, 2013

vol_viz

First experiment with visualizing VolSourceEstimates using pynax (https://github.com/AlexandreAbraham/pynax).

One problem seems to be that the T1.mgz dimensions doesn't correspond to the anatomical directions that pynax assumes. @AlexandreAbraham, it seems to me that pynax should use the header info to do this, or is there an other better/easier way to re-orient the data before supplying them to pynax?

@agramfort
Copy link
Member

you mean because of :

In [6]: img.get_affine().astype(int)
Out[6]:
array([[ -1, 0, 0, 122],
[ 0, 0, 1, -118],
[ 0, -1, 0, 100],
[ 0, 0, 0, 1]])

?

@mluessi
Copy link
Contributor Author

mluessi commented Jun 27, 2013

@agramfort yes, exactly. We could use the transform matrix to reshape the image, s.t., the dimensions are the way pynax assumes they should be. Or, pynax could accept a transform matrix which enables it to know how to interpret the data. The latter would be the cleaner/more efficient solution IMO.

@agramfort
Copy link
Member

I guess there is a bit of work ...

@AlexandreAbraham
Copy link

@mluessi Applying a transform matrix is definitely something I would like to do.

However, this is not possible in Pynax for the moment. Without going too much in the details, Pynax is a very low level API that gives you easy efficient interactive plotting, that's it. It is very low level, you have lots of freedom but you won't go beyond displaying simple numpy arrays.

Applying a transform matrix is a very good candidate for a layer that would go above the current Pynax implementation.

Now, you may want to fix your problem quickly. Here are the solutions:

  • apply the transform matrix yourself, which is the cleanest solution I think
  • as your affine is very simple, you can fix the problem yourself by playing with the coordinates of each slices (switch the 'h' and 'v', you can also put '-v' to flip data in one direction before displaying it)

@mluessi
Copy link
Contributor Author

mluessi commented Jun 27, 2013

@AlexandreAbraham Thanks for the explanation. For the example, we can leave the index array hard coded such that it works with the example dataset. But if we add a plot function, we will have to format the index list based on the transform matrix (shouldn't be very difficult).

@agramfort
Copy link
Member

+1 for taking care of this in stc.plot

@dengemann
Copy link
Member

Wooot! Looks very promising. Let us know when to review.

@mluessi mluessi mentioned this pull request Sep 11, 2013
10 tasks
@dengemann
Copy link
Member

@mluessi 0.7 or 0.8?

@dengemann
Copy link
Member

@mluessi can we close this, in favor of #1822 ?

@agramfort
Copy link
Member

yes.

reopen if you need

@agramfort agramfort closed this Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants