Changeset 184 for plugins


Ignore:
Timestamp:
Dec 28, 2011, 2:32:57 PM (7 years ago)
Author:
tjniskan
Message:
  • Fixed ASL plugin for certain Bruker data.

M plugins/calc_asl_cbf.m
M aedes_revision.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/calc_asl_cbf.m

    r129 r184  
    5050  end
    5151else
    52   % Check that the number of images is OK
    53   if rem(size(DATA{1}.FTDATA,3),2)~=0 || size(DATA{1}.FTDATA,3)==1
    54         h=errordlg('The number of input images has to be divisible by 2!',...
    55           'Error','modal');
    56         return
    57   end
    58   if isfield(DATA{1}.PROCPAR,'ltype') && ...
    59       length(DATA{1}.PROCPAR.ltype)==size(DATA{1}.FTDATA,3)
    60     control_ind = find(strcmpi(DATA{1}.PROCPAR.ltype,'c'));
    61     label_ind = find(strcmpi(DATA{1}.PROCPAR.ltype,'l'));
    62     controlIm = DATA{1}.FTDATA(:,:,control_ind);
    63     labelIm = DATA{1}.FTDATA(:,:,label_ind);
    64     ParentFileName = fullfile(DATA{1}.HDR.fpath,DATA{1}.HDR.fname);
    65   else
    66     controlIm = DATA{1}.FTDATA(:,:,1:2:size(DATA{1}.FTDATA,3));
    67     labelIm = DATA{1}.FTDATA(:,:,2:2:size(DATA{1}.FTDATA,3));
    68     ParentFileName = fullfile(DATA{1}.HDR.fpath,DATA{1}.HDR.fname);
    69   end
     52       
     53        if strcmpi(DATA{1}.DataFormat,'bruker_reco')
     54                % Assume that Bruker data is 4D
     55                if rem(size(DATA{1}.FTDATA,4),2)~=0 || size(DATA{1}.FTDATA,4)==1
     56                        h=errordlg('The number of input images has to be divisible by 2!',...
     57                                'Error','modal');
     58                        return
     59                end
     60               
     61                controlIm = squeeze(DATA{1}.FTDATA(:,:,2,:));
     62                labelIm = squeeze(DATA{1}.FTDATA(:,:,1,:));
     63                ParentFileName = fullfile(DATA{1}.HDR.fpath,DATA{1}.HDR.fname);
     64        else
     65                % Check that the number of images is OK
     66                if rem(size(DATA{1}.FTDATA,3),2)~=0 || size(DATA{1}.FTDATA,3)==1
     67                        h=errordlg('The number of input images has to be divisible by 2!',...
     68                                'Error','modal');
     69                        return
     70                end
     71                if isfield(DATA{1}.PROCPAR,'ltype') && ...
     72                                length(DATA{1}.PROCPAR.ltype)==size(DATA{1}.FTDATA,3)
     73                        control_ind = find(strcmpi(DATA{1}.PROCPAR.ltype,'c'));
     74                        label_ind = find(strcmpi(DATA{1}.PROCPAR.ltype,'l'));
     75                        controlIm = DATA{1}.FTDATA(:,:,control_ind);
     76                        labelIm = DATA{1}.FTDATA(:,:,label_ind);
     77                        ParentFileName = fullfile(DATA{1}.HDR.fpath,DATA{1}.HDR.fname);
     78                else
     79                        controlIm = DATA{1}.FTDATA(:,:,1:2:size(DATA{1}.FTDATA,3));
     80                        labelIm = DATA{1}.FTDATA(:,:,2:2:size(DATA{1}.FTDATA,3));
     81                        ParentFileName = fullfile(DATA{1}.HDR.fpath,DATA{1}.HDR.fname);
     82                end
     83        end
    7084end
    7185
     
    170184end
    171185
     186% Open in a new Aedes window
     187aedes(fullfile(fp,fn))
    172188
    173189
     
    178194
    179195
     196
     197
Note: See TracChangeset for help on using the changeset viewer.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008