## marsbar-users

 [Marsbar-users] calculating the variance inside a ROI From: Nikola Valchev - 2012-11-13 18:57:12 ```Dear Matthew Brett, I am trying to calculate the variance of my parameter estiamtes inside a ROI for a given contrast. This instead of a mean as a summary statistic. So far I have managed to extract the raw signal from my voxels in the the ROI but then calculating the parameter estimates for a given contrast gets a bit tricky. Can you suggest a method to me? I tried to search through the forum and found some similar posts but that didn't help too much. Best regards Nikola Valchev ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Matthew Brett - 2012-11-13 22:56:31 ```Hi, On Tue, Nov 13, 2012 at 10:30 AM, Nikola Valchev wrote: > Dear Matthew Brett, > I am trying to calculate the variance of my parameter estiamtes inside a ROI for a given contrast. This instead of a mean as a summary statistic. So far I have managed to extract the raw signal from my voxels in the the ROI but then calculating the parameter estimates for a given contrast gets a bit tricky. Can you suggest a method to me? I tried to search through the forum and found some similar posts but that didn't help too much. You can get the variance from the ROI using batch, something like: D = mardo('SPM.mat'); roi = maroi('my_roi.mat'); mY = get_marsy(roi, D, 'mean'); [y, y_var] = summary_data(mY); If you want you can then estimate using the y_var: E = estimate(D, y_var); and so on. Does that make sense? The batch examples in the FAQ might help too. Best, Matthew ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Nikola Valchev - 2012-11-14 12:19:12 ```Thank you for your quick answer. Just to be sure here is what I run as a batch: D = mardo('SPM.mat'); roi = maroi('my_roi.mat'); mY = get_marsy(roi, D, 'mean'); [y, y_var] = summary_data(mY); E = estimate(D, y_var); E = set_contrasts(E, xCon); b= betas(E); marsS = compute_contrasts(E, [003, 006, 009]); # my contrasts of interest I trued it for one subject and it works but I was a bit puzzled to see a negative value for the variance and that is why I wanted to be sure the batch is correct. Thank you very much again. Nikola Matthew Brett wrote: > Hi, > > On Tue, Nov 13, 2012 at 10:30 AM, Nikola Valchev wrote: >> Dear Matthew Brett, >> I am trying to calculate the variance of my parameter estiamtes inside a ROI for a given contrast. This instead of a mean as a summary statistic. So far I have managed to extract the raw signal from my voxels in the the ROI but then calculating the parameter estimates for a given contrast gets a bit tricky. Can you suggest a method to me? I tried to search through the forum and found some similar posts but that didn't help too much. > You can get the variance from the ROI using batch, something like: > > D = mardo('SPM.mat'); > roi = maroi('my_roi.mat'); > mY = get_marsy(roi, D, 'mean'); > [y, y_var] = summary_data(mY); > > If you want you can then estimate using the y_var: > > E = estimate(D, y_var); > > and so on. Does that make sense? The batch examples in the FAQ might help too. > > Best, > > Matthew > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from \$795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Marsbar-users mailing list > Marsbar-users@... > https://lists.sourceforge.net/lists/listinfo/marsbar-users ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Matthew Brett - 2012-11-14 21:15:57 ```Hi, On Wed, Nov 14, 2012 at 4:18 AM, Nikola ValchHi,ev wrote: > Thank you for your quick answer. > Just to be sure here is what I run as a batch: > > D = mardo('SPM.mat'); > roi = maroi('my_roi.mat'); > mY = get_marsy(roi, D, 'mean'); > [y, y_var] = summary_data(mY); > E = estimate(D, y_var); > > E = set_contrasts(E, xCon); > b= betas(E); > marsS = compute_contrasts(E, [003, 006, 009]); # my contrasts of interest > > > > I trued it for one subject and it works but I was a bit puzzled to see a > negative value for the variance and that is why I wanted to be sure the > batch is correct. Yes, a negative variance is surprising - where was the negative value exactly - in y_var? Best, Matthew ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Nikola Valchev - 2012-11-15 09:37:23 ```Hi, The negatives are in marsS.con since I estimate using y_var and not y, that is where the mean variances for the parameter estimates should be, right? Thanks Nikola Matthew Brett wrote: > Hi, > > On Wed, Nov 14, 2012 at 4:18 AM, Nikola ValchHi,ev wrote: >> Thank you for your quick answer. >> Just to be sure here is what I run as a batch: >> >> D = mardo('SPM.mat'); >> roi = maroi('my_roi.mat'); >> mY = get_marsy(roi, D, 'mean'); >> [y, y_var] = summary_data(mY); >> E = estimate(D, y_var); >> >> E = set_contrasts(E, xCon); >> b= betas(E); >> marsS = compute_contrasts(E, [003, 006, 009]); # my contrasts of interest >> >> >> >> I trued it for one subject and it works but I was a bit puzzled to see a >> negative value for the variance and that is why I wanted to be sure the >> batch is correct. > Yes, a negative variance is surprising - where was the negative value > exactly - in y_var? > > Best, > > Matthew > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from \$795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Marsbar-users mailing list > Marsbar-users@... > https://lists.sourceforge.net/lists/listinfo/marsbar-users ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Matthew Brett - 2012-11-15 18:22:39 ```Hi, On Wed, Nov 14, 2012 at 4:18 AM, Nikola Valchev wrote: > Thank you for your quick answer. > Just to be sure here is what I run as a batch: > > D = mardo('SPM.mat'); > roi = maroi('my_roi.mat'); > mY = get_marsy(roi, D, 'mean'); > [y, y_var] = summary_data(mY); > E = estimate(D, y_var); > > E = set_contrasts(E, xCon); > b= betas(E); > marsS = compute_contrasts(E, [003, 006, 009]); # my contrasts of interest > > > > I trued it for one subject and it works but I was a bit puzzled to see a > negative value for the variance and that is why I wanted to be sure the > batch is correct. Well - a subtraction between variances might be negative. I expect all of y_var to be 0 or positive, but the betas in your model will depend on your model, and the contrasts are subtractions between betas, basically, so they will not necessarily be positive... Best, Matthew ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Nikola Valchev - 2012-11-19 14:26:27 ```Dear Matthew Brett, After some thinking and discussions I'm not sure if what I'm getting from this batch is what I meant. My ROIs represent the TMS stimulation points for each individual subject. I have this hypothesis that TMS more than modulating the BOLD signal in the targeted area has "injected noise" in it. I.E. the distribution of the parameter estimates in the target point ROI is wider. That can be measured by comparing the variances of the parameter estimates in the ROIs. That said, when I extract the variances in the way below, even if I do it for a simple contrast of one predictor I get negative values. Which makes me think that it is still a contrast predictor VS. baseline. I suppose it comes from estimating the model on y_var Isn't there another way for doing it? For instance Getting all the mean parameter estimates from the ROI per voxel (so taking away the time dimension) and calculating the variance on them? I hope I'm clear enough. Thank you Nikola Matthew Brett wrote: > Hi, > > On Wed, Nov 14, 2012 at 4:18 AM, Nikola Valchev wrote: >> Thank you for your quick answer. >> Just to be sure here is what I run as a batch: >> >> D = mardo('SPM.mat'); >> roi = maroi('my_roi.mat'); >> mY = get_marsy(roi, D, 'mean'); >> [y, y_var] = summary_data(mY); >> E = estimate(D, y_var); >> >> E = set_contrasts(E, xCon); >> b= betas(E); >> marsS = compute_contrasts(E, [003, 006, 009]); # my contrasts of interest >> >> >> >> I trued it for one subject and it works but I was a bit puzzled to see a >> negative value for the variance and that is why I wanted to be sure the >> batch is correct. > Well - a subtraction between variances might be negative. I expect > all of y_var to be 0 or positive, but the betas in your model will > depend on your model, and the contrasts are subtractions between > betas, basically, so they will not necessarily be positive... > > Best, > > Matthew > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from \$795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Marsbar-users mailing list > Marsbar-users@... > https://lists.sourceforge.net/lists/listinfo/marsbar-users ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Matthew Brett - 2012-11-19 18:11:54 ```Hi, On Mon, Nov 19, 2012 at 6:26 AM, Nikola Valchev wrote: > Dear Matthew Brett, > After some thinking and discussions I'm not sure if what I'm getting > from this batch is what I meant. > > My ROIs represent the TMS stimulation points for each individual > subject. I have this hypothesis that TMS more than modulating the BOLD > signal in the targeted area has "injected noise" in it. I.E. the > distribution of the parameter estimates in the target point ROI is > wider. That can be measured by comparing the variances of the parameter > estimates in the ROIs. That said, when I extract the variances in the > way below, even if I do it for a simple contrast of one predictor I get > negative values. Sorry - just to clarify - where are the negative values - in the y_var vector? If so - can you send me somehow the data that you are using for the script and I will have a look... Best, Matthew ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Nikola Valchev - 2012-11-20 15:44:13 ```Hello, Thank you for your answer. y_var contains positive values. The negative values come after estimating the model using y_var. I see how this can come from the fact that compare the variances of the parameter estimates associated with two different predictors, but then it becomes very difficult for me to interpret what we are comparing and why. My hypothesis is that TMS induces noise in the targeted region and that noise can be measured through the dispersion of the parameter estimate values in the target point ROIs. This dispersion has two dimensions, in time (across volumes) and in space (across voxels), I'm more interested in the second one, although it is still a question if it is possible to combine them. Naively thinking if I have a matrix of time series (voxels in lines and volumes in columns), which contains the parameter estimates for each voxel per volume I can calculate the mean, std, or variance per column or per line. I can do that for the raw data, but I would like to be able to estimate the effect of the TMS stimulation in that region for a particular contrast of interest. The variance associated with one predictor A can be higher than that associated with another predictor B, but if I have one value (parameter estimate, not variance) per voxel per time point, the distribution of those values cannot be negative. That is where my confusion comes from. I hope this is a bit more clear. I can send you the roi.mat file and the [y, y_var] structure, but the whole data from where I extract my time series is too big for mails. Thanks again. Nikola Matthew Brett wrote: > Hi, > > On Mon, Nov 19, 2012 at 6:26 AM, Nikola Valchev wrote: >> Dear Matthew Brett, >> After some thinking and discussions I'm not sure if what I'm getting >> from this batch is what I meant. >> >> My ROIs represent the TMS stimulation points for each individual >> subject. I have this hypothesis that TMS more than modulating the BOLD >> signal in the targeted area has "injected noise" in it. I.E. the >> distribution of the parameter estimates in the target point ROI is >> wider. That can be measured by comparing the variances of the parameter >> estimates in the ROIs. That said, when I extract the variances in the >> way below, even if I do it for a simple contrast of one predictor I get >> negative values. > Sorry - just to clarify - where are the negative values - in the y_var vector? > > If so - can you send me somehow the data that you are using for the > script and I will have a look... > > Best, > > Matthew > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from \$795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Marsbar-users mailing list > Marsbar-users@... > https://lists.sourceforge.net/lists/listinfo/marsbar-users ```
 [Marsbar-users] Extraction Threshold From: Kwaku Akrofi - 2012-11-30 23:36:24 Attachments: Message as HTML ```Hi MarsBar Users,   I have yet another two other questions. They came up during discussions with a colleague and I don't have the answers yet. I need your help.   A. When I use Design -> Set design from file, Data -> Extract ROI (default), and Results -> Estimate Results, do I simply get the mean value of all voxels in the ROI across time, or only the mean value of voxels within the ROI whose T values exceed the threshold stated in the SPM.mat file? In short, is there a threshold for ROI extraction?   B. Is there a way I can estimate the number of voxels in an ROI? I know I can calculate the ROI's volume, since I know the radius, and divide by the number 27  (i.e. 3-by-3-by-3) to find the volume of the ROI in voxels, but this doesn't quite give an accurate picture, as voxels are cubes and my ROI is spherical.   Thank you all very much in advance. Just for perspecitve, I've outlined my procedure below: 1. ROI Definition -> Sphere [I enter the coordinates of the center of the sphere and proceed from there.] 2. Design -> Set design from file. [Here, I choose the SPM.mat file for a prior GLM analysis on an individual.] 3. Data -> Extract ROI (default). [I select the ROI created in Step 1.] 4. Results -> Estimate Results 5. Data -> Export Data -> Summary time course(s) for region(s) -> Text file.   Enjoy the weekend, Kwaku.```
 Re: [Marsbar-users] Extraction Threshold From: Matthew Brett - 2012-12-01 00:52:38 ```Hi. On Fri, Nov 30, 2012 at 3:36 PM, Kwaku Akrofi wrote: > Hi MarsBar Users, > > I have yet another two other questions. They came up during discussions with > a colleague and I don't have the answers yet. I need your help. > > A. When I use Design -> Set design from file, Data -> Extract ROI (default), > and Results -> Estimate Results, do I simply get the mean value of all > voxels in the ROI across time, or only the mean value of voxels within the > ROI whose T values exceed the threshold stated in the SPM.mat file? In > short, is there a threshold for ROI extraction? No, there is no statistical threshold, you get all the voxels (at least, all the voxels that have signal for all time points). > B. Is there a way I can estimate the number of voxels in an ROI? > I know I can calculate the ROI's volume, since I know the radius, and divide > by the number 27 (i.e. 3-by-3-by-3) to find the volume of the ROI in > voxels, but this doesn't quite give an accurate picture, as voxels are cubes > and my ROI is spherical. Well, you could try something like: my_roi = maroi('my_roi.mat'); my_voxel_roi = maroi_matrix(my_roi, 'an_image_with_the_right_voxel_sizes.img'); disp(volume(my_voxel_roi); Does that work? Best, Matthew ```
 Re: [Marsbar-users] calculating the variance inside a ROI From: Matthew Brett - 2012-12-01 02:46:11 ```Hi, On Tue, Nov 20, 2012 at 7:43 AM, Nikola Valchev wrote: > Hello, > Thank you for your answer. > > y_var contains positive values. > The negative values come after estimating the model using y_var. I see > how this can come from the fact that compare the variances of the > parameter estimates associated with two different predictors, but then > it becomes very difficult for me to interpret what we are comparing and > why. My hypothesis is that TMS induces noise in the targeted region and > that noise can be measured through the dispersion of the parameter > estimate values in the target point ROIs. This dispersion has two > dimensions, in time (across volumes) and in space (across voxels), I'm > more interested in the second one, although it is still a question if it > is possible to combine them. Naively thinking if I have a matrix of time > series (voxels in lines and volumes in columns), which contains the > parameter estimates for each voxel per volume I can calculate the mean, > std, or variance per column or per line. Right. y, and y_var are the mean and variance respectively, per line. > I can do that for the raw data, > but I would like to be able to estimate the effect of the TMS > stimulation in that region for a particular contrast of interest. The > variance associated with one predictor A can be higher than that > associated with another predictor B, but if I have one value (parameter > estimate, not variance) per voxel per time point, the distribution of > those values cannot be negative. That is where my confusion comes from. > I hope this is a bit more clear. Oh - dear - no - I am not following you. The variances will be positive, I'm glad they are. If you apply some model to the variances, including a mean, then the parameters from this model can be positive or negative (other than the mean, which must be positive). Does that make sense? Best, Matthew ```
 [Marsbar-users] Error Message with Mardo From: Kwaku Akrofi - 2012-12-05 22:55:50 Attachments: Message as HTML ```Hi All, I am strying to build on the example provided in Section 4.4 of the MArsbar 0.43 manual to write a MATLAB script for my MarsBar operations. I have:  spm_name = '/model_implicit/SPM.mat'; D = mardo(spm_name); But the mardo command gives me the following error: ??? Undefined function or method 'spm_get' for input arguments of type 'char'. Error in ==> mardo.mardo at 178   fname  = spm_get('CPath', fname); How do I fix it? I am using SPM8 running on MATLAB R2010b on Red Hat Linux Enterprise Desktop 5. Thanks a lot, Kwaku.```
 Re: [Marsbar-users] Error Message with Mardo From: Kwaku Akrofi - 2012-12-06 16:47:05 Attachments: Message as HTML ```I figured it out. It turns out spm_get is for SPM2. I replaced it with spm_select for SPM8 and it works now.   Thanks, Kwaku.   From: Kwaku Akrofi >To: MarsBaR users list >Sent: Wednesday, 5 December 2012, 16:55 >Subject: [Marsbar-users] Error Message with Mardo > > >Hi All, > > >I am strying to build on the example provided in Section 4.4 of the MArsbar 0.43 manual to write a MATLAB script for my MarsBar operations. I have: > > > spm_name = '/model_implicit/SPM.mat'; > >D = mardo(spm_name); > > > >But the mardo command gives me the following error: > > >??? Undefined function or method 'spm_get' for input arguments of type 'char'. >Error in ==> mardo.mardo at 178 >  fname  = spm_get('CPath', fname); > > >How do I fix it? > > >I am using SPM8 running on MATLAB R2010b on Red Hat Linux Enterprise Desktop 5. > > > >Thanks a lot, > > >Kwaku. > > > > > >------------------------------------------------------------------------------ >LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial >Remotely access PCs and mobile devices and provide instant support >Improve your efficiency, and focus on delivering more value-add services >Discover what IT Professionals Know. Rescue delivers >http://p.sf.net/sfu/logmein_12329d2d >_______________________________________________ >Marsbar-users mailing list >Marsbar-users@... >https://lists.sourceforge.net/lists/listinfo/marsbar-users > > >```
 Re: [Marsbar-users] Error Message with Mardo From: Matthew Brett - 2012-12-06 17:58:51 ```Hi, On Thu, Dec 6, 2012 at 8:46 AM, Kwaku Akrofi wrote: > I figured it out. It turns out spm_get is for SPM2. I replaced it with > spm_select for SPM8 and it works now. Many thanks for getting back to the list. But - spm_get should work because marsbar has a copy of spm_get that calls spm_select, for compatibility. Is it possible that you did not run >> marsbar('on') before your script? That command sets the paths to pick up these compatibility routines. Best, Matthew ```
 Re: [Marsbar-users] Error Message with Mardo From: Kwaku Akrofi - 2012-12-06 18:30:27 Attachments: Message as HTML ```Indeed I did not run marsbar('on')! I'll remember to do that next time. Thanks, Matt!   Kwaku.   From: Matthew Brett >To: Kwaku Akrofi ; MarsBaR users list >Sent: Thursday, 6 December 2012, 11:58 >Subject: Re: [Marsbar-users] Error Message with Mardo > >Hi, > >On Thu, Dec 6, 2012 at 8:46 AM, Kwaku Akrofi wrote: >> I figured it out. It turns out spm_get is for SPM2. I replaced it with >> spm_select for SPM8 and it works now. > >Many thanks for getting back to the list.  But - spm_get should work >because marsbar has a copy of spm_get that calls spm_select, for >compatibility.  Is it possible that you did not run > >>> marsbar('on') > >before your script?  That command sets the paths to pick up these >compatibility routines. > >Best, > >Matthew > > >```
 [Marsbar-users] Greating Spherical and Box ROIs without Interactive Involvement From: Kwaku Akrofi - 2012-12-16 06:01:50 Attachments: Message as HTML ```Hi All,   I would like to ask whether the creation of an ROI in MarsBar can be automated, especially relatively simple ROIs like spherical or box ROIs. Clearly one reason why the GUI requires human interaction is the need to enter the coordinates of the center of the sphere and choose the radius of the ROI.   Woud it be possible for save the coordinates of the center, the radius, in an Excel file and have Marsbar 0.45 read the center and radius from the Excel file, thus requiring not human interaction?   Thanks and regards, Kwaku.```
 [Marsbar-users] Creating Spherical and Box ROIs without GUI Interaction From: Kwaku Akrofi - 2012-12-16 14:20:40 Attachments: Message as HTML ```Hi MarsBar people,   My previous e-mail had too many typos; sorry about that! Let me correct that:  I would like to ask whether the creation of an ROI in MarsBar can be automated (i.e. run from an m-file script without the need for interaction via the GUI), especially relatively simple ROIs like spherical or box ROIs. Clearly one reason why the GUI requires human interaction is the need to enter the coordinates of the center of the sphere and choose the radius of the ROI. Woud it be possible for save the radius and the coordinates of the center in an Excel file and have Marsbar read them from the file , thus requiring no human interaction? Thanks and regards, Kwaku. >________________________________ > From: Kwaku Akrofi >To: MarsBaR users list >Sent: Sunday, 16 December 2012, 0:01 >Subject: [Marsbar-users] Greating Spherical and Box ROIs without Interactive Involvement > > >Hi All, >  >I would like to ask whether the creation of an ROI in MarsBar can be automated, especially relatively simple ROIs like spherical or box ROIs. Clearly one reason why the GUI requires human interaction is the need to enter the coordinates of the center of the sphere and choose the radius of the ROI. >  >Woud it be possible for save the coordinates of the center, the radius, in an Excel file and have Marsbar 0.45 read the center and radius from the Excel file, thus requiring not human interaction? >  >Thanks and regards, >Kwaku. >  >  >  >  >  >  >  >  >  >  >------------------------------------------------------------------------------ >LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial >Remotely access PCs and mobile devices and provide instant support >Improve your efficiency, and focus on delivering more value-add services >Discover what IT Professionals Know. Rescue delivers >http://p.sf.net/sfu/logmein_12329d2d >_______________________________________________ >Marsbar-users mailing list >Marsbar-users@... >https://lists.sourceforge.net/lists/listinfo/marsbar-users > > > ```
 Re: [Marsbar-users] Creating Spherical and Box ROIs without GUI Interaction From: Matthew Brett - 2012-12-24 18:16:09 ```Hi, On Sun, Dec 16, 2012 at 2:20 PM, Kwaku Akrofi wrote: > Hi MarsBar people, > > My previous e-mail had too many typos; sorry about that! Let me correct > that: > > I would like to ask whether the creation of an ROI in MarsBar can be > automated (i.e. run from an m-file script without the need for interaction > via the GUI), especially relatively simple ROIs like spherical or box ROIs. > Clearly one reason why the GUI requires human interaction is the need to > enter the coordinates of the center of the sphere and choose the radius of > the ROI. > Woud it be possible for save the radius and the coordinates of the center in > an Excel file and have Marsbar read them from the file , thus requiring no > human interaction? Please don't worry about typos, I make lots of them. Yes, you can batch creation of sphere and box ROIs, something like: sphere_info = struct('centre', [10 12 13],'radius', 10); % in mm sphere_roi = maroi_sphere(sphere_info); box_info = struct('centre', [5 -7 3], 'widths', [10 20 30]); box_roi = maroi_box(box_info); might work... Sorry - I don't have a matlab installation to test on, on my laptop. Best, Matthew ```
 Re: [Marsbar-users] Creating Spherical and Box ROIs without GUI Interaction From: Kwaku Akrofi - 2012-12-28 22:35:56 Attachments: Message as HTML ```Hi Matthew, I have tried the sphere creation commands and they do create an spherical ROI object. Would you know what the function for saving the ROI object to a .mat file is? It is the final step I need. Thanks and Happy Holidays, Kwaku. >________________________________ > From: Matthew Brett >To: Kwaku Akrofi ; MarsBaR users list >Sent: Monday, 24 December 2012, 12:16 >Subject: Re: [Marsbar-users] Creating Spherical and Box ROIs without GUI Interaction > >Hi, > >On Sun, Dec 16, 2012 at 2:20 PM, Kwaku Akrofi > wrote: >> Hi MarsBar people, >> >> My previous e-mail had too many typos; sorry about that! Let me correct >> that: >> >> I would like to ask whether the creation of an ROI in MarsBar can be >> automated (i.e. run from an m-file script without the need for interaction >> via the GUI), especially relatively simple ROIs like spherical or box ROIs. >> Clearly one reason why the GUI requires human interaction is the need to >> enter the coordinates of the center of the sphere and choose the radius of >> the ROI. >> Woud it be possible for save the radius and the coordinates of the center in >> an Excel file and have Marsbar read them from the file , thus requiring no >> human interaction? > >Please don't worry about typos, I make lots of them. > >Yes, you can batch creation of sphere and box ROIs, something like: > >sphere_info = struct('centre', [10 12 13],'radius', 10); % in mm >sphere_roi = maroi_sphere(sphere_info); > >box_info = struct('centre', [5 -7 3], 'widths', [10 20 30]); >box_roi = maroi_box(box_info); > >might work...  Sorry - I don't have a matlab installation to test on, >on my laptop. > >Best, > >Matthew > > >```
 Re: [Marsbar-users] Creating Spherical and Box ROIs without GUI Interaction From: Matthew Brett - 2012-12-28 22:39:39 ```Hi, On Fri, Dec 28, 2012 at 10:35 PM, Kwaku Akrofi wrote: > Hi Matthew, > > I have tried the sphere creation commands and they do create an spherical > ROI object. Would you know what the function for saving the ROI object to a > .mat file is? It is the final step I need. Try: saveroi(box_roi, 'my_box_roi.mat'); http://marsbar.sourceforge.net/apidocs/marsbar/@maroi/saveroi.html Best, Matthew ```
 Re: [Marsbar-users] Creating Spherical and Box ROIs without GUI Interaction From: Kwaku Akrofi - 2012-12-28 22:45:28 Attachments: Message as HTML ```Thanks a lot! Kwaku. >________________________________ > From: Matthew Brett >To: Kwaku Akrofi >Cc: MarsBaR users list >Sent: Friday, 28 December 2012, 16:39 >Subject: Re: [Marsbar-users] Creating Spherical and Box ROIs without GUI Interaction > >Hi, > >On Fri, Dec 28, 2012 at 10:35 PM, Kwaku Akrofi > wrote: >> Hi Matthew, >> >> I have tried the sphere creation commands and they do create an spherical >> ROI object. Would you know what the function for saving the ROI object to a >> .mat file is? It is the final step I need. > >Try: > >saveroi(box_roi, 'my_box_roi.mat'); > >http://marsbar.sourceforge.net/apidocs/marsbar/@maroi/saveroi.html > >Best, > >Matthew > > >```