neuroelf:neuroelf_resources
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
neuroelf:neuroelf_resources [2014/12/05 21:13] – [Installation] igorkagan | neuroelf:neuroelf_resources [2022/12/29 07:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== NeuroElf Resources ====== | ====== NeuroElf Resources ====== | ||
+ | |||
+ | ===== Online resources ===== | ||
http:// | http:// | ||
Line 7: | Line 9: | ||
https:// | https:// | ||
+ | ===== Help ===== | ||
+ | For getting detailed help on each method of xff object (e.g. fmr), use: | ||
+ | <code matlab> | ||
+ | >> fmr.Help % to see all methods | ||
+ | >> fmr.Help(' | ||
+ | </ | ||
+ | See http:// | ||
- | ---- | + | === NeuroElf-based ERA === |
- | ===== DAG notes ===== | ||
+ | http:// | ||
- | ==== Installation ==== | + | http:// |
- | 1) During installation, | + | |
- | 2) Starting from NeuroElf_v09d, | + | ===== DAG installation notes ===== |
+ | |||
+ | 1) During installation, | ||
+ | |||
+ | 2) NeuroElf functions use std.m and var.m as in newer versions of MATLAB, with 3 inputs: e.g. Y = STD(X, | ||
+ | Therefore, old NaN toolbox functions std.m and var.m were incompatible and sterr.m was updated. The old version of std.m is now available as ig_std.m in Igtools (corrcoef_eval.m has not been revised yet but is not needed for running the pipeline). | ||
+ | |||
+ | 3) Starting from NeuroElf_v09d, | ||
and reside in **..\@neuroelf\private**. They can be placed in the path (i.e. copied to the main NeuroElf folder, it is not possible to add to path this private folder directly), or accessed as described in [main installation folder] / README.html > Function library: | and reside in **..\@neuroelf\private**. They can be placed in the path (i.e. copied to the main NeuroElf folder, it is not possible to add to path this private folder directly), or accessed as described in [main installation folder] / README.html > Function library: | ||
<code matlab> | <code matlab> | ||
Line 24: | Line 39: | ||
</ | </ | ||
+ | :-O The functions below should be in the NeuroElf base (root) folder (e.g. D: | ||
- | Currently required functions for DAG NeuroElf-based functions (\Sources\MATLAB\bv_umg): | + | {{:neuroelf:neuroelf_base_folder_ikdag20150815.png?600|}} |
- | * findfiles | + | |
- | * checkstruct | + | |
- | * renamefile | + | |
- | * dicom_dic | + | |
- | Used by ne_pl_fmriqasheet.m: | + | |
- | * psctrans | + | |
- | * packmosaic | + | |
- | * scaledata | + | |
- | * minmaxmean | + | |
- | * splittocell | + | |
- | ==== Help ==== | + | |
- | For getting detailed help on each method of xff object (e.g. fmr), use: | + | |
- | <code matlab> | + | |
- | >> fmr.Help % to see all methods | + | |
- | >> fmr.Help(' | + | |
- | </ | + | |
- | See http:// | + | |
- | ---- | + | 4) There is a bug in NeuroElf |
- | NeuroElf-based ERA | + | |
- | http:// | + | <code matlab dcm_Value.m> |
+ | function dcmval = dcm_Value(hfile, | ||
+ | % DCM:: | ||
+ | % | ||
+ | % FORMAT: | ||
+ | % | ||
+ | % Input fields: | ||
+ | % | ||
+ | % | ||
+ | % | ||
+ | % | ||
+ | % Output fields: | ||
+ | % | ||
+ | % | ||
+ | % | ||
+ | % Using: makelabel, splittocell. | ||
+ | |||
+ | % Version: | ||
+ | % Build: | ||
+ | % Date: | ||
+ | % Author: | ||
+ | % URL/ | ||
+ | % | ||
+ | % Copyright (c) 2010, 2011, 2014, Jochen Weber | ||
+ | % All rights reserved. | ||
+ | % | ||
+ | % Redistribution and use in source and binary forms, with or without | ||
+ | % modification, | ||
+ | % * Redistributions of source code must retain the above copyright | ||
+ | % | ||
+ | % * Redistributions in binary form must reproduce the above copyright | ||
+ | % | ||
+ | % | ||
+ | % * Neither the name of Columbia University nor the | ||
+ | % names of its contributors may be used to endorse or promote products | ||
+ | % | ||
+ | % | ||
+ | % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
+ | % ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
+ | % WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
+ | % DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
+ | % DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
+ | % (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
+ | % LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
+ | % ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
+ | % (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
+ | % SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
+ | |||
+ | % neuroelf library | ||
+ | global ne_methods; | ||
+ | |||
+ | % persistent dictionaries | ||
+ | persistent dcmv_dicts | ||
+ | if isempty(dcmv_dicts) | ||
+ | dcmv_dicts | ||
+ | |||
+ | % load standard dict | ||
+ | dcmv_dicts.OFFIS = ne_methods.dicom_dic(); | ||
+ | |||
+ | end | ||
+ | |||
+ | % only valid for single file | ||
+ | if nargin < 2 || ... | ||
+ | numel(hfile) ~= 1 || ... | ||
+ | | ||
+ | error( ... | ||
+ | ' | ||
+ | ' | ||
+ | mfilename ... | ||
+ | ); | ||
+ | end | ||
+ | |||
+ | % dict | ||
+ | bc = xffgetcont(hfile.L); | ||
+ | dict = bc.DataDictionary; | ||
+ | |||
+ | % check key | ||
+ | if ischar(vkey) | ||
+ | vkey = vkey(: | ||
+ | if length(vkey) == 9 && ... | ||
+ | | ||
+ | vkey = vkey([1: | ||
+ | end | ||
+ | if length(vkey) == 8 && ... | ||
+ | | ||
+ | | ||
+ | vkey = [' | ||
+ | elseif ~strcmp(vkey, | ||
+ | error( ... | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | else | ||
+ | if isempty(dict) | ||
+ | warning( ... | ||
+ | ' | ||
+ | 'Data dictionary not looked up.' ... | ||
+ | ); | ||
+ | dcm_DetectDictionary(hfile, | ||
+ | dict = bc.DataDictionary; | ||
+ | end | ||
+ | if ~isfield(dcmv_dicts, | ||
+ | error( ... | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | end | ||
+ | dict = dcmv_dicts.(dict); | ||
+ | if ~isfield(dict, | ||
+ | error( ... | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | end | ||
+ | vkey = dict.(vkey); | ||
+ | if isfield(bc.DataKeyLookup, | ||
+ | dcmval = bc.Data(bc.DataKeyLookup.(vkey)).Value; | ||
+ | elseif isfield(bc.MetaKeyLookup, | ||
+ | dcmval = bc.Meta(bc.MetaKeyLookup.(vkey)).Value; | ||
+ | elseif nargin > 2 | ||
+ | dcmval = varargin{1}; | ||
+ | else | ||
+ | error( ... | ||
+ | ' | ||
+ | 'Given DICOM tag key not present in file.' ... | ||
+ | ); | ||
+ | end | ||
+ | dcmval = interpret_dcmval(dcmval); | ||
+ | return; | ||
+ | end | ||
+ | if ~isfield(bc.DataKeyLookup, | ||
+ | if nargin < 3 | ||
+ | error( ... | ||
+ | ' | ||
+ | 'Given DICOM tag not present in file.' ... | ||
+ | ); | ||
+ | else | ||
+ | dcmval = varargin{1}; | ||
+ | dcmval = interpret_dcmval(dcmval); | ||
+ | return; | ||
+ | end | ||
+ | end | ||
+ | dcmval = bc.Data(bc.DataKeyLookup.(vkey)).Value; | ||
+ | dcmval = interpret_dcmval(dcmval); | ||
+ | |||
+ | % numeric key format | ||
+ | elseif isa(vkey, ' | ||
+ | if numel(vkey) == 2 && ... | ||
+ | | ||
+ | try | ||
+ | dcmval = dcm_Value(hfile, | ||
+ | catch ne_eo; | ||
+ | rethrow(ne_eo); | ||
+ | end | ||
+ | elseif numel(vkey) == 1 && ... | ||
+ | nargin > 2 && ... | ||
+ | isa(varargin{1}, | ||
+ | | ||
+ | | ||
+ | vkey >= 0 && ... | ||
+ | vkey < 65536 && ... | ||
+ | numel(varargin{1}) == 1 && ... | ||
+ | | ||
+ | | ||
+ | varargin{1} >= 0 && ... | ||
+ | varargin{1} < 65536 | ||
+ | try | ||
+ | dcmval = dcm_Value(hfile, | ||
+ | catch ne_eo; | ||
+ | rethrow(ne_eo); | ||
+ | end | ||
+ | else | ||
+ | error( ... | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | end | ||
+ | dcmval = interpret_dcmval(dcmval); | ||
+ | |||
+ | else | ||
+ | error( ... | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | end | ||
+ | |||
+ | |||
+ | % sub function | ||
+ | function dcmval = interpret_dcmval(dcmval) | ||
+ | global ne_methods; | ||
+ | if ischar(dcmval) && ... | ||
+ | | ||
+ | dcmval = dcmval(: | ||
+ | if ~isempty(regexpi(dcmval, | ||
+ | ' | ||
+ | dcmvalc = ne_methods.splittocell(dcmval, | ||
+ | dcmvaln = zeros(1, numel(dcmvalc)); | ||
+ | try | ||
+ | for vc = 1: | ||
+ | dcmvaln(vc) = str2double(dcmvalc{vc}); | ||
+ | end | ||
+ | catch ne_eo; | ||
+ | neuroelf_lasterr(ne_eo); | ||
+ | return; | ||
+ | end | ||
+ | dcmval = dcmvaln; | ||
+ | end | ||
+ | elseif isnumeric(dcmval) | ||
+ | dcmval = double(dcmval); | ||
+ | end | ||
+ | % end of function dcmval = interpret_dcmval(dcmval) | ||
+ | </ | ||
- | http:// |
neuroelf/neuroelf_resources.1417814027.txt.gz · Last modified: 2022/12/29 07:15 (external edit)