WriteBrik problem

I am trying to convert matrices of analysis from matlab to afni files and something is not working.
I have info file of a mask that has the same dimensions as the file I want to write to brik, and I am using this info as input for WriteBrik.
I adjusted the scale to 1 and view to tlrc.
after running:

[err, errM, Info] = WriteBrik(mask,maskInfo,Opt)

this is the Info I get:

Info = 

  struct with fields:

              RootName: 'full_mask.sub1.s2.movie1.ME+tlrc'
          DATASET_RANK: [3 1 0 0 0 0 0 0]
           BRICK_TYPES: 0
       ORIENT_SPECIFIC: [1 2 4]
                ORIGIN: [96 132 -78]
                 DELTA: [-1.5000 -1.5000 1.5000]
            BRICK_LABS: '#0'
            SCENE_DATA: [2 0 1 -999 -999 -999 -999 -999]
           IDCODE_DATE: 'Tue Jul 19 04:08:47 2022'
               LABEL_1: 'zyxt'
               LABEL_2: 'zyxt'
          DATASET_NAME: 'zyxt'
            WORSLEY_DF: []
         WORSLEY_NCONJ: []
          WORSLEY_FWHM: []
              TypeName: 'byte'
             TypeBytes: 1
             ByteOrder: 'ieee-le'
           Orientation: [3×2 char]
            FileFormat: 'BRIK'
          Extension_1D: ''
    DATASET_DIMENSIONS: [129 153 129 0 0]
           BRICK_STATS: [0 1]

  • I deleted the History Note since it was too long - all the history of the “full_mask” file I used for the info file was there. could this be the problem?

The HEAD and BRIK files are written to the folder but afni can’t open them.

Thanks in advance!

Hmm, try copying the dataset first to a temporary dataset to use as a template, outside of Matlab, with “3dcopy mydset+tlrc mycopy”. Remove the history of the copy there with “3drefit -denote mycopy+tlrc”. Then try the Matlab BrikLoad and WriteBrik with the copy. If it still doesn’t work, I can take a closer look. PM me for upload instructions.