brainlife / app-dtiinit

Runs vistasoft/dtiInit to preprocess and register dwi to anat/t1
2 stars 2 forks source link

Application gets stuck with warning dialog #2

Closed soichih closed 6 years ago

soichih commented 6 years ago

I've noticed a job stuck on matlab2 VM with following output.

[hayashis@js-- 59fb6912ae4ee000300f16c2]$ cat stdout.log 
starting matlab

                            < M A T L A B (R) >
                  Copyright 1984-2016 The MathWorks, Inc.
                   R2016a (9.0.0.341360) 64-bit (glnxa64)
                             February 11, 2016

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

    Academic License

loading paths (VM)

config = 

              x0x5F_outputs: {[1x1 struct]}
                  x0x5F_tid: 10
                  x0x5F_app: '58c56cf7e13a50849b258800'
               x0x5F_inputs: {[1x1 struct]  [1x1 struct]}
             phaseEncodeDir: '2'
                 resolution: [1x0 char]
    rotateBvecsWithCanXform: 1
          rotateBvecsWithRx: 1
                eddyCorrect: '1'
                         t1: '../59fb680e66b329002a87f719/t1.nii.gz'
                        dwi: '../59fb68c366b329002a87f723/dwi.nii.gz'
                      bvecs: '../59fb68c366b329002a87f723/dwi.bvecs'
                      bvals: '../59fb68c366b329002a87f723/dwi.bvals'

loading dwi resolution
Data will be saved to: . 

ans = 

           outSuffix: '_aligned_trilin'
      mrDiffusionDir: '/usr/local/vistasoft/mrDiffusion'
             dataDir: '../59fb68c366b329002a87f723'
          inBaseName: 'dwi'
          subjectDir: '.'
            mnB0Name: './dwi_b0.nii.gz'
         outBaseName: 'dwi_aligned_trilin'
          outBaseDir: './dwi_aligned_trilin'
           inBaseDir: '../59fb68c366b329002a87f723/dwi'
           bvalsFile: '../59fb68c366b329002a87f723/dwi.bvals'
           bvecsFile: '../59fb68c366b329002a87f723/dwi.bvecs'
              ecFile: './dwi_aligned_trilin_ecXform.mat'
            acpcFile: './dwi_aligned_trilin_acpcXform.mat'
    alignedBvecsFile: './dwi_aligned_trilin.bvecs'
    alignedBvalsFile: './dwi_aligned_trilin.bvals'
    dwAlignedRawFile: './dwi_aligned_trilin.nii.gz'

Loading raw data...
Data will be saved to: . 
Dims = [106 90 64 137] 
Data Dir = ../59fb68c366b329002a87f723 
Output Dir = . 
t1FileName = ../59fb680e66b329002a87f719/t1.nii.gz;
freq_dim not set correctly in NIFTI header.
phase_dim not set correctly in NIFTI header.
Warning: dialog is no longer supported when MATLAB is started with the
-nodisplay or -noFigureWindows option or there is no display. For more
information, see "Changes to -nodisplay and -noFigureWindows Startup Options"
in the MATLAB Release Notes. To view the release note in your system browser,
run web('www.mathworks.com/help/matlab/release-notes.html#br5ktrh-3',
'-browser') 
> In warnfiguredialog (line 21)
  In dialog (line 35)
  In inputdlg (line 123)
  In dtiInitPhaseDim (line 42)
  In dtiInit (line 95)
  In main (line 49) 

It looks like if this app receives an invalid data, it tries to warn user something and never finishes. We should update it so that Matlab will crash if it tries to open dialog.

kitchell commented 6 years ago

I think this is due to the change yesterday. what was the resolution config input?

soichih commented 6 years ago

@kitchell

[hayashis@js-- 59fb6912ae4ee000300f16c2]$ cat config.json
{
...
    "phaseEncodeDir": "2",
    "resolution": "",
    "rotateBvecsWithCanXform": true,
    "rotateBvecsWithRx": true,
    "eddyCorrect": "1",
    "t1": "../59fb680e66b329002a87f719/t1.nii.gz",
    "dwi": "../59fb68c366b329002a87f723/dwi.nii.gz",
    "bvecs": "../59fb68c366b329002a87f723/dwi.bvecs",
    "bvals": "../59fb68c366b329002a87f723/dwi.bvals"
}
[hayashis@js-- 59fb6912ae4ee000300f16c2]$ mrinfo ../59fb680e66b329002a87f719/t1.nii.gz
************************************************
Image:               "../59fb680e66b329002a87f719/t1.nii.gz"
************************************************
  Format:            NIfTI-1.1
  Dimensions:        181 x 217 x 181
  Voxel size:        1 x 1 x 1
  Dimension labels:  0. left->right (mm)
                     1. posterior->anterior (mm)
                     2. inferior->superior (mm)
  Data type:         signed 16 bit integer (little endian)
  Data layout:       [ +0 +1 +2 ]
  Data scaling:      offset = 0, multiplier = 1
  Comments:          AVERAGE:
  Transform:                    1           0           0         -90
                                0           1           0        -126
                                0           0           1         -72
                                0           0           0           1
[hayashis@js-- 59fb6912ae4ee000300f16c2]$ mrinfo ../59fb68c366b329002a87f723/dwi.nii.gz
************************************************
Image:               "../59fb68c366b329002a87f723/dwi.nii.gz"
************************************************
  Format:            NIfTI-1.1
  Dimensions:        106 x 90 x 64 x 137
  Voxel size:        2 x 2 x 2 x 2.4
  Dimension labels:  0. left->right (mm)
                     1. posterior->anterior (mm)
                     2. inferior->superior (mm)
                     3. undefined (?)
  Data type:         signed 16 bit integer (little endian)
  Data layout:       [ -0 +1 +2 +3 ]
  Data scaling:      offset = 0, multiplier = 1
  Comments:          (none)
  Transform:                    1          -0          -0        -104
                                0           1          -0         -73
                                0          -0           1         -53
                                0           0           0           1
[hayashis@js-- 59fb6912ae4ee000300f16c2]$ cat ../59fb68c366b329002a87f723/dwi.bvals
0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 0 1500 1500 1500 1500 1500 1500 1500 1500
[hayashis@js-- 59fb6912ae4ee000300f16c2]$ ls -lah ../59fb68c366b329002a87f723/dwi.nii.gz
-rw-r--r-- 1 hayashis hayashis 50M Nov  2 15:50 ../59fb68c366b329002a87f723/dwi.nii.gz
kitchell commented 6 years ago

ok I think matlab is not reading '' as empty as we thought it would

kitchell commented 6 years ago

ok can you try it again? I changed it so brainlife config.resolution will = 'default' if no resolution is givien and matlab looks for that instead of an empty string

soichih commented 6 years ago

I've rerun dtiinit with a fresh config but it's still getting stuck somewhere.

[> In warnfiguredialog (line 21)
  In uiwait (line 40)
  In inputdlg (line 344)
  In dtiInitPhaseDim (line 42)
  In dtiInit (line 95)
  In main (line 49)]

I have following options set on my config.json

  "phaseEncodeDir": "2",
  "resolution": "default",
  "rotateBvecsWithCanXform": true,
  "rotateBvecsWithRx": true,
  "eddyCorrect": "1",
  "t1": "../59fdd38747c68d002aad3414/58f55826af44920021b9e0b3/t1.nii.gz",
  "dwi": "../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa/dwi.nii.gz",
  "bvecs": "../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa/dwi.bvecs",
  "bvals": "../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa/dwi.bvals",
bcmcpher commented 6 years ago

resolution has to be a numeric array of voxel dimensions, like [ 1.25 1.25 1.25 ].

"default" should be the native dwi resolution.

Brent

On Tue, Nov 7, 2017 at 11:02 AM, Soichi Hayashi notifications@github.com wrote:

I've rerun dtiinit with a fresh config but it's still getting stuck somewhere.

[�> In warnfiguredialog (line 21) In uiwait (line 40) In inputdlg (line 344) In dtiInitPhaseDim (line 42) In dtiInit (line 95) In main (line 49)]�

I have following options set on my config.json

"phaseEncodeDir": "2", "resolution": "default", "rotateBvecsWithCanXform": true, "rotateBvecsWithRx": true, "eddyCorrect": "1", "t1": "../59fdd38747c68d002aad3414/58f55826af44920021b9e0b3/t1.nii.gz", "dwi": "../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa/dwi.nii.gz", "bvecs": "../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa/dwi.bvecs", "bvals": "../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa/dwi.bvals",

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brain-life/app-dtiinit/issues/2#issuecomment-342530405, or mute the thread https://github.com/notifications/unsubscribe-auth/ANRr_V69aCIRRlI2yNjqMwI6B_K0Iq80ks5s0H8vgaJpZM4QRRGM .

kitchell commented 6 years ago

no, it should read default and then determine the native resolution. im not sure why it is not. ill have to debug later.

kitchell commented 6 years ago

ok I think the issue is that you can't compare strings with == in matlab, must use strcmp.

kitchell commented 6 years ago

testing now

kitchell commented 6 years ago

Actually I dont htink that was the problem. @soichih were you also seeing: Warning: dialog is no longer supported when MATLAB is started with the -nodisplay or -noFigureWindows option or there is no display. For more information, see "Changes to -nodisplay and -noFigureWindows Startup Options" in the MATLAB Release Notes. To view the release note in your system browser, run web('www.mathworks.com/help/matlab/release-notes.html#br5ktrh-3', '-browser')

soichih commented 6 years ago

Yes. Here is the full stdout output.

starting matlab

                            < M A T L A B (R) >
                  Copyright 1984-2016 The MathWorks, Inc.
                   R2016a (9.0.0.341360) 64-bit (glnxa64)
                             February 11, 2016

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

    Academic License

loading paths (VM)

config = 

              x0x5F_outputs: {[1x1 struct]}
                  x0x5F_tid: 3
                  x0x5F_app: '58c56cf7e13a50849b258800'
               x0x5F_inputs: {[1x1 struct]  [1x1 struct]}
                      bvals: '../59fdd38747c68d002aad3414/58f53f95af449200...'
                      bvecs: '../59fdd38747c68d002aad3414/58f53f95af449200...'
                        dwi: '../59fdd38747c68d002aad3414/58f53f95af449200...'
                         t1: '../59fdd38747c68d002aad3414/58f55826af449200...'
                eddyCorrect: '1'
          rotateBvecsWithRx: 1
    rotateBvecsWithCanXform: 1
                 resolution: 'default'
             phaseEncodeDir: '2'

loading dwi resolution
Data will be saved to: . 

ans = 

           outSuffix: '_aligned_trilin'
      mrDiffusionDir: '/usr/local/vistasoft/mrDiffusion'
             dataDir: '../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa'
          inBaseName: 'dwi'
          subjectDir: '.'
            mnB0Name: './dwi_b0.nii.gz'
         outBaseName: 'dwi_aligned_trilin'
          outBaseDir: './dwi_aligned_trilin'
           inBaseDir: '../59fdd38747c68d002aad3414/58f53f95af44920021b9e0a...'
           bvalsFile: '../59fdd38747c68d002aad3414/58f53f95af44920021b9e0a...'
           bvecsFile: '../59fdd38747c68d002aad3414/58f53f95af44920021b9e0a...'
              ecFile: './dwi_aligned_trilin_ecXform.mat'
            acpcFile: './dwi_aligned_trilin_acpcXform.mat'
    alignedBvecsFile: './dwi_aligned_trilin.bvecs'
    alignedBvalsFile: './dwi_aligned_trilin.bvals'
    dwAlignedRawFile: './dwi_aligned_trilin.nii.gz'

Loading raw data...
Data will be saved to: . 
Dims = [173 207 173 79] 
Data Dir = ../59fdd38747c68d002aad3414/58f53f95af44920021b9e0aa 
Output Dir = . 
t1FileName = ../59fdd38747c68d002aad3414/58f55826af44920021b9e0b3/t1.nii.gz;
freq_dim not set correctly in NIFTI header.
phase_dim not set correctly in NIFTI header.
[Warning: dialog is no longer supported when MATLAB is started with the
-nodisplay or -noFigureWindows option or there is no display. For more
information, see "Changes to -nodisplay and -noFigureWindows Startup Options"
in the MATLAB Release Notes. To view the release note in your system browser,
run web('www.mathworks.com/help/matlab/release-notes.html#br5ktrh-3',
'-browser')] 
[> In warnfiguredialog (line 21)
  In dialog (line 35)
  In inputdlg (line 123)
  In dtiInitPhaseDim (line 42)
  In dtiInit (line 95)
  In main (line 49)] 
[Warning: uiwait is no longer supported when MATLAB is started with the
-nodisplay or -noFigureWindows option or there is no display. For more
information, see "Changes to -nodisplay and -noFigureWindows Startup Options"
in the MATLAB Release Notes. To view the release note in your system browser,
run web('www.mathworks.com/help/matlab/release-notes.html#br5ktrh-3',
'-browser')] 
[> In warnfiguredialog (line 21)
  In uiwait (line 40)
  In inputdlg (line 344)
  In dtiInitPhaseDim (line 42)
  In dtiInit (line 95)
  In main (line 49)]
kitchell commented 6 years ago

dtiinit uses inputdlg which is no longer supported with -nodisplay tag for matlab. Do we need to run matlab with -nodisplay on karst/carbonate? we do right?

kitchell commented 6 years ago

ah no! it is because of the phase encode dir config input.

kitchell commented 6 years ago

Well the issue was appearing because phaseEncodeDir: '2', 2 is a string not a number. but this did then bring up a new problem, which is that vistsoft then opens a dialog box asking for the encode direction, but since matlab is run with -nodisplay tag the dialog box could not pop up, thus getting stuck.

kitchell commented 6 years ago

i believe it is fixed now.