[RESOLVED] General_extract_roi_glm_values

Hi, I am trying to find detailed documentation/examples for the function general_extract_roi_glm_values. Nothing comes up when I type qunex general_extract_roi_glm_values and I cannot find it on the wiki. Would you be able to point me to detailed documentation for this function? I ran general_find_peaks and need to extract beta values. thank you.

Hi!

It seems that there is an issue with accessing inline help for QuNex commands that were developed in MATLAB. We plan to hotfix this and publish an updated container this week.

So you can run the command without waiting for this hotfix I am pasting the documentation below.

If there is something else I can help (e.g. any other commands where inline help is currently inaccessible), let me know.


%``function [] = general_extract_roi_glm_values(flist, roif, effects, frames, values, tformat, verbose)`
%
%	Extracts per ROI estimates of specified effects from a volume or cifti GLM
%   files as specified in the file list.
%
%   INPUTS
%   ======
%
%   --flist       List of sessions and files to process.
%   --roif        .names ROI file descriptor.
%   --outf        Name of the output file. If left empty the it is set to list 
%                 root with '.dat' extension. []
%   --effects     List of effects of interest. If none specified, all but trend 
%                 and baseline are exported. []
%   --frames      List of frames to extract from all effects. All if empty or 
%                 not specified. []
%   --values 	  In what form to extract the estimates. Possibilities are raw 
%                 beta values ('raw') or percent signal change ('psc') values. 
%                 ['raw']
%   --tformat     A comma separated string specifying in what format the data is 
%                 to be extracted. It can be a combination of:
%
%                 - 'mat'  ... a matlab file,
%                 - 'wide' ... wide format txt file with one line per session
%                   and each ROI and estimate in a separate column,
%                 - 'long' ... long format txt file with one line per estimate
%                   extracted with columns describing the session, ROI, effect 
%                   and frame that it belongs to. The minimum, maximum, median, 
%                   standard deviation, and standard error of the values within 
%                   the ROI are reported, as well as the number of effective 
%                   voxels within the ROI.
%
%	--verbose		Whether to report on progress or not. [not]
%
%   OUTPUT
%   ======
%
%   The results are saved in the specified file but also returned in a
%   datastructure.
%
%   USE
%   ===
%
%   The function is used to extract per ROI estimates of the effects of interest
%   for each of the ROI and sessions to enable second level analysis and
%   visualization of the data. In the background the function first extracts the
%   relevant volumes using the img_extract_glm_estimates. It then defines the ROI
%   and uses img_extract_roi_stats method to get per ROI statistics.
%
%   EXAMPLE USE
%   ===========
%
%   ::
%
%       general_extract_roi_glm_values('wm-glm.list', 'CCN.names', [], 'encoding, ...
%       delay', [], 'psc', 'long');
%

This has been resolved. A new QuNex version (0.91.10) will be available on Grace and from source on GitLab today. A new container will be released tomorrow or on Monday at the latest.

Hi, I’m looking for some more information about this command usage. I have a volume file that contains all subjects’ beta weights and a mask file generated from some results. It’s not obvious to me how a binarized mask file would be used within the context of general_extract_roi_glm_values since I don’t need to use a list file (I have a single volume file) and I don’t have a names file.

There used to be a script in the legacy qunex that accomplished this goal, like so:

${TOOLS}/${QUNEXREPO}/connector/functions/ROIExtract.sh --roifile=‘ttest_OCDCont_minus_Neut_OCD_v_nonOCD_N45_tfce_ztstat_fwep_C1_mask05.dscalar.nii’ --inputfile=‘OCDCont_minus_Neut_N45.dtseries.nii’ --outpath=’/gpfs/loomis/pi/n3/Studies/Pittenger.OCD.MBproc/analysis/palm/N45_OCDHC_OCD_v_HC’ --outname=‘ttest_OCDCont_minus_Neut_OCD_v_nonOCD_N45_tfce_ztstat_fwep_C1_mask05_subjectwise_metrics’

That script appears to be long gone. If you could point me to the script’s new home on Grace, that would be easy–otherwise, I would very much appreciate some further guidance for how to accomplish this ROI mask/extract task in qunex. Thanks in advance!

Hi Rachel,

I believe you are looking for the extract_roi QuNex command (qunex extract_roi). This command actually uses the script you are mentioning above. The script itself along with its source code can be found at qunex/bash/qx_utilities/extract_roi.sh or (${TOOLS}/${QUNEXREPO}/bash/qx_utilities/extract_roi.sh in your case).