Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Support Forums
 Analysis Software Support
 Matlab path

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
vinod Posted - Jul 19 2007 : 11:53:01 AM
How do I customize my Matlab path on BIAC computers? Usually, I create a startup.m file to the startup work directory but on BIAC machines, I dont have permission to create one. I tried to change the pathdef file to have these permanently but don't have permission to do that either. I don't want to be adding things like user_scripts folder on Gall each time I write a script.
8   L A T E S T    R E P L I E S    (Newest First)
charles.michelich Posted - Jul 29 2007 : 12:03:02 AM
sub2ind does not take an array of coordinates, but it will take vectors of coordinates as inputs. Therefore, an "elegant" way to accomplish your goal is:

voxelData = data(sub2ind(size(data), coord(:,1), coord(:,2), coord(:,3)));
vinod Posted - Jul 20 2007 : 3:12:46 PM
Thanks guys. My instincts were the same too but just wanted to be sure there was no other 'elegant' way to do this.
josh.bizzell Posted - Jul 20 2007 : 3:03:07 PM
To further what Syam suggested, you can use the function "sub2ind" to create the scalar index from the coordinates.

>> idx = sub2ind([91,109,91],coordx,coordy,coordz);

However, I believe you'll still have to loop through the coordinates because this function doesn't take array inputs for the coordinates.

-Josh
syam.gadde Posted - Jul 20 2007 : 12:36:17 PM
A loop is the only way I can think of accessing the multi-dimensional array. Your listed methods won't work. An alternative is to think of the data matrix as a one-dimensional array, and convert your coordinates to indices into that one-dimensional array. If you index a multi-dimensional matrix with a scalar i like this:

data(i)

Then i is treated as an index into the "flattened" data. You can also send a list:

data([i1, i2, i3, i4, i5, i6, ...])

which will return a list of the values at each of those flattened indices. Note that this is different than:

data(i1, i2, i3, i4, i5, i6)

which would be indexing into a 6-D array with a 6-D coordinate.
vinod Posted - Jul 20 2007 : 11:03:57 AM
Here is another matlab question:

I have a data matrix which is a 3-d matrix of size 91x109x91 (FSL standard)
I have a bunch of ROI coordinates in a variable coords, dimension = 115x3 corresponding to 115 voxels in my ROI

Without having to loop through each coordinate and extracting the corresponding value from the data matrix, is there an easier way to get the data values for each of the 115 voxels.

I tried ROIdata = data(coords) and ROIdata = data(coords(:,1),coords(:,2),coords(:,3)) but it doesn't do it.
vinod Posted - Jul 19 2007 : 12:05:50 PM
Thanks guys, that worked. And Josh beat petty by 48 secs :), but petty had more things to type :)
petty Posted - Jul 19 2007 : 11:55:55 AM
put a startup.m file in your user drive (U:\), when you start matlab it should find that file.

just add multiple addpath comments in the file.
josh.bizzell Posted - Jul 19 2007 : 11:55:07 AM
Put your startup.m file in the top level of your user directory (the U: drive), and it should work.

BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.34 seconds. Snitz Forums 2000