azamm | 8 Feb 20:48
Picon
Gravatar

Extract ROI data using command line

Hi All,

I am trying to figure out command line for extracting ROI data from 90 ROIs (full options), using an SPM
design with 72 time-points (3 runs x 24 images/run). 

When I complete this process in the GUI, these are the steps I follow:
1.  'Extract ROI data' (full options) > Select ROIs
2.  Use SPM design > Yes 
3.  Images from > SPM design
4. Scaling from > SPM design
5. Save output to .mat file

The resulting .mat file contains five variables, Y (72x90 double), Yvar(72x90 double), block_rows (1x3
cell), descrip (lists ROIs), info (1x1 struct), regions(1x90 cell), and sumfunc('mean').  

Would anyone be able to tell me exactly how to replicate this output using command line and/or a script?

Your help would be much appreciated.

Thanks in advance, 
Anna  
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Matthew Brett | 7 Feb 20:09
Picon
Gravatar

Re: [SPM] Build Marsbar ROIs

Hi,

On Tue, Feb 7, 2012 at 4:55 PM, Anna Zamm <azamm <at> caregroup.org> wrote:
> Hi All,
> I would like to write a batch script that loops through a directory with 90 .img files and builds a marsbar
ROI (roi.mat) for each file.  I tried using maroi_image(filename) to do this, but Matlab gave me an error
message ('Undefined function or method 'spm_get' for input arguments of type 'char').   Any
suggestions on how to successfully batch this process would be much appreciated.
> Thanks in advance,

I think you want the marsbar mailing list for this one.

You may have omitted the line:

marsbar('on')

from your script.  This sets the paths correctly to run the rest of
the marsbar functions,

Best,

Matthew

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
(Continue reading)

zxcv | 6 Feb 12:23
Picon
Picon
Gravatar

Import/Build ROI


What is the difference between building and ROI and importing one? Why are
there the two function with seemingly similar themes but very different
results?
--

-- 
View this message in context: http://old.nabble.com/Import-Build-ROI-tp33270807p33270807.html
Sent from the MarsBaR mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Chris McNorgan | 2 Feb 19:31
Picon
Gravatar

Re: loading an existing .nii file using maroi_image


This reminds me very much of a phone call down to Roy on the IT Crowd. I 
must have snipped that very critical line out of the script I was 
working from.

Thanks, turning on marsbar does, in fact, appear to be necessary for 
marsbar to function, and including the marsbar('on') line allows the 
script to run (at least as far as I've written it).

> >  ??? Warning: Struct field assignment overwrites a value with class "char".
> >    See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As
> >  Structures Displays Warning for details.
> >    >  In maroi_image.maroi_image at 34
> >     In getcom at 29
> >  ??? Undefined function or method 'spm_get' for input arguments of type
> >  'char'.
>
> Did you try "marsbar('on')" at the beginning of your script?
>
> Best,
>
> Matthew

--

-- 
Chris McNorgan
Postdoctoral Research Fellow
Developmental Cognitive Neuroscience Lab
Roxelyn and Richard Pepper Department of Communication Sciences&  Disorders
Northwestern University
2240 Campus Drive
(Continue reading)

Chris McNorgan | 2 Feb 18:32
Picon
Gravatar

loading an existing .nii file using maroi_image

Hi all,

I'm working on a utility script to enumerate all the clusters in an 
arbitrary .nii file (most likely binarised) and get the centers of mass 
and volume for each of them. It looks like marsbar has the necessary 
tools. Step one is loading the .nii file, which is where I am stuck:

     file_root='/path/to/file';
     thisvolfilename = 'filename.nii';
     vol_file = fullfile(file_root, thisvolfilename);
     fname=vol_file
     %load the volume
     IMG = maroi_image(fname);

executing the snippet (using real file names in a real filesystem):

fname =

/mnt/ldata/Seimens/language/crossmodal/ROIS/LFG.nii

??? Warning: Struct field assignment overwrites a value with class "char".
  See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As 
Structures Displays Warning for details.
 > In maroi_image.maroi_image at 34
   In getcom at 29
??? Undefined function or method 'spm_get' for input arguments of type 
'char'.

Error in ==> my_roifname at 22
roifname = spm_get('cpath', roifname);
(Continue reading)

Picon
Favicon

I: ROI


>----Messaggio originale----
>Da: valentina-fin <at> libero.it
>Data: 25/01/2012 11.48
>A: <marsbar-users <at> lists.sourceforge.net>
>Ogg: ROI
>
>
>
>>
>>hello MarsBaR experts,
>>I'm writing you because I would need to ask your help on MarsBaR
>>I  want to knwn if it is possible extract one or more ROI made of a fixed 
>>volume of oriented parallelepiped (box) that is not necessary parallel to 
>>planes of image; each box must have voxel information that we have after co-
>>registration (i.e. we must keep analogous information). In detail  I want 
to 
>>select hyppocampus. Is it possible using MarsBaR?
>>Would you be so kind to give me some indication of where I can find this 
>>information please?
>>I would be very grateful if you could suggest me some articles or function 
>>that will help me in my research. Thank you very much.
>>Thank you very much for your time.
>>
>>
>>
>>Kind Regards
>>Valentina 
>>
>>
(Continue reading)

Picon
Favicon

ROI


>
>hello MarsBaR experts,
>I'm writing you because I would need to ask your help on MarsBaR
>I  want to knwn if it is possible extract one or more ROI made of a fixed 
>volume of oriented parallelepiped (box) that is not necessary parallel to 
>planes of image; each box must have voxel information that we have after co-
>registration (i.e. we must keep analogous information). In detail  I want to 
>select hyppocampus. Is it possible using MarsBaR?
>Would you be so kind to give me some indication of where I can find this 
>information please?
>I would be very grateful if you could suggest me some articles or function 
>that will help me in my research. Thank you very much.
>Thank you very much for your time.
>
>Looking forward to hearing from you.
>
>Kind Regards
>Valentina 
>
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
LiuKarl | 21 Jan 02:02
Picon
Gravatar

Help for extracting values using Marsbar

Hello, Dr. Matthew

 

I am using Marsbar to extract values from one small blob near the edge of brain. It failed by showing the message below

 

“Warning: No valid data for roi 1 (dep>hc_-45_47_-14)

 

In xxx/spm5/toolbox/marsbarII/ <at> maroi/get_marsy.m at line 80

In xxx/spm5/toolbox/marsbarII/marsbar.m at line 985

??? No appropriate methods for function block_rows.

Error in ==> xxx/spm5/toolbox/marsbarII/marsbar.m

On line 986  ==> marsY = block_rows(marsY, row);

Error in ==> xxx/spm5/spm.m

On line 1604  ==> evalin('base',CBs{v-1})

??? Error while evaluating uicontrol Callback.”

 

Then I checked the marsbar website and found some suggested fix. In my case, I typed the codes below in matlab:

 

roi_filename = 'dep>hc_-45_47_-14';

my_roi = maroi(roi_filename);

my_roi = spm_hold(my_roi, 0);

saveroi(my_roi, roi_filename);

 

(if my understanding is correct, it will overwrite the previous roi with the same name but using a different resampling method, right?)

 

But even when I use this “new” generated roi to rerun the extraction, the warning message still shows up. Now I am feeling lost. Can you help me out? Since my project is stuck with this, if you can reply to me sooner, I really appreciate it.

 

Thanks a lot!

 

Karl 

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Marsbar-users mailing list
Marsbar-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/marsbar-users
hamed nili | 19 Jan 11:23
Picon
Gravatar

importing binary masks in marsbar

Does anyone know of a way to import a user-defined binary mask to marsbar? I have many subjects and roi sizes and want to do it with script. The problem is to make the binary mask applicable to the ‘maroi’ function. 
 
Thanks,
Hamed
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Marsbar-users mailing list
Marsbar-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/marsbar-users
Picon
Favicon

ROI

hello MarsBaR experts,
I'm writing you because I would need to ask your help on MarsBaR
I  want to knwn if it is possible extract one or more ROI made of a fixed 
volume of oriented parallelepiped (box) that is not necessary parallel to 
planes of image; each box must have voxel information that we have after co-
registration (i.e. we must keep analogous information). In detail  I want to 
select hyppocampus. Is it possible using MarsBaR?
Would you be so kind to give me some indication of where I can find this 
information please?
I would be very grateful if you could suggest me some articles or function 
that will help me in my research. Thank you very much.
Thank you very much for your time.

Looking forward to hearing from you.

Kind Regards
Valentina 

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
becky_lawson | 16 Jan 18:16
Picon
Picon
Favicon

import issues - help much appreciated!


Hello,

Hello, I made some native space ROIs in MriCron (NIFTI .img/.hdr files) and
imported them to marsbar (using the import function) in order to have
marsbar readable versions of said ROIs so that I could perform a signal
extraction from associated  beta images using marsbar. This all worked fine.
My results look great.

I would now like to calculate a ratio of average roi volume to wholebrain
volume for each of my subjects. I have a whole brain mask (NIFTI .img/.hdr)
which I would like to import into marsbar (effectively treating it as a
large ROI) in order to view the marsbar-calculated whole brain volume to
work out my ratio.

When I import said whole brain mask using the masrbar GUI or a script it
produces multiple wholebrain_n_roi.mat files (as little as ten or as many as
a couple of hundred! - either way, I was expecting a single
wholebrain_1_roi.mat file that relates accurately to the whole brain mask
(.img/.hdr) image that I imported). These individual files, when viewed in
marsbar, appear imcomplete in themselves and, while a vague approximation of
the mask I originally imported, are poor quality and many in number.

I'm a tad confused now. When I imported my individual subject ROIs the
output was just a single roi_1_roi.mat file for each subject as I expected.
These imported ROIs look fine when viewed in marsbar, although the ROI is
very small (~30mm3) so it's difficult to be absolutely sure that something
hasn't gone amiss here as well as when importing the whole brain masks.

I'm not sure what to do next. Any help appreciated!

Becky.
--

-- 
View this message in context: http://old.nabble.com/import-issues---help-much-appreciated%21-tp33148979p33148979.html
Sent from the MarsBaR mailing list archive at Nabble.com.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2

Gmane