methlabUZH / automagic

Automagic
GNU General Public License v3.0
94 stars 32 forks source link

Error when turning off ICA step #62

Closed iustinaabc closed 2 years ago

iustinaabc commented 2 years ago

Dear Automagic developers,

I'm currently running Automagic from a larger EEG pipeline, where it was integrated as a preprocessing step. I tried turning off the ICA parameters by defining it an empty struct in my parameters file 'ICLabelParams', struct([]),...

however I get the following error log in Matlab:

A dot name structure assignment is illegal when the structure is empty.  Use a subscript on the structure.

Error in preprocess (line 128)
ICLabelParams.addETdataParams = p.Results.addETdataParams;

Error in Block/preprocess (line 521)
            [EEG, fig1, fig2, fig3] = preprocess(data, self.params);

Error in Project/preprocessAll (line 502)
                [EEG, automagic] = block.preprocess();

Error in omsi.chain.automagic_toolbox (line 130)
        project.preprocessAll();

Error in omsi.main_aadMovingTarget>analyse (line 207)
        params.operations{idx}(params);

Error in omsi.main_aadMovingTarget (line 168)
             analyse(storyParams);

For more background, p.Results has the following content

ans = 

  struct with fields:

           addETdataParams: [1×1 struct]
    ChannelReductionParams: [0×0 struct]
                 CRDParams: [1×1 struct]
          DetrendingParams: [0×0 struct]
                 EEGSystem: [1×1 struct]
       EOGRegressionParams: [0×0 struct]
              FilterParams: [1×1 struct]
             HighvarParams: [0×0 struct]
             ICLabelParams: [0×0 struct]
       InterpolationParams: [1×1 struct]
                MARAParams: [0×0 struct]
              MinvarParams: [0×0 struct]
             ORIGINAL_FILE: ''
                PrepParams: [0×0 struct]
                RPCAParams: [0×0 struct]
                  Settings: [1×1 struct]
            TrimDataParams: [1×1 struct]
         TrimOutlierParams: [1×1 struct]

Overall it seems as if it's not possible to skip the IC Label step. Do you have any insights on this?

Kind regards, Iustina

ksgfan commented 2 years ago

Hi Iustina,

it is a known issue and it is fixed in the development version.

Just go to preprocessing/preprocess.m and replace the line 128

 ICLabelParams.addETdataParams = p.Results.addETdataParams;

with

if ~isempty(ICLabelParams)
    ICLabelParams.addETdataParams = p.Results.addETdataParams;
end

Best, Dawid

iustinaabc commented 2 years ago

Thanks a lot, this did the trick!