Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.10 not designed to handle optional dki inputs? #25

Open
soichih opened this issue Aug 12, 2020 · 0 comments
Open

1.10 not designed to handle optional dki inputs? #25

soichih opened this issue Aug 12, 2020 · 0 comments

Comments

@soichih
Copy link
Contributor

soichih commented Aug 12, 2020

Maria is trying to feed tensor input to v1.10 of this App.

image

This tensor came from mrtrix3-act App, and it looks like it has the tensor files (fa/md/rd/ad) but not dki outputs (ga,mk,ak,rk).

Although dki files are note there, the App is designed to set file paths for both tensor and dki in config.json

image

The config.json for this instance looks like this

{
    "fiberbased": false,
    "numnodes": 200,
    "fa": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/fa.nii.gz",
    "md": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/md.nii.gz",
    "rd": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/rd.nii.gz",
    "ad": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/ad.nii.gz",
    "ga": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/ga.nii.gz",
    "ak": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/ak.nii.gz",
    "mk": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/mk.nii.gz",
    "rk": "../5f339be8a5b6436f18a51d07/5e892832fa1b635c18262639/rk.nii.gz",
    "afq": "../5f339be8a5b6436f18a51d07/5e8a9faafa1b63511127cbdf/classification.mat",
    "tck": "../5f339be8a5b6436f18a51d07/5e892832fa1b6375c3262636/track.tck",

(ga,ak,mk,rk) paths are set, but they points to missing file, in this instance.

main.m of this App then decide if it has dki input or not simply by looking for the config.json key like this

    % dki
    if isfield(config,dki(1))
        for kk = 1:length(dki)
            measures{ii+kk} = dir(config.(dki{kk}));
        end
        end_index = [end_index end_index+length(dki)];
        scale_index = [scale_index ["false","false","false","false"]];
        value_units = [value_units ["unitless","um^2/msec","um^2/msec","um^2/msec"]];
    	inverse_units = [inverse_units ["unitless","msec/um^2","msec/um^2","um^2/msec"]];
    end

The isfield(config,dki(1)) will always evaluate to true because config.ga will always set even though the file might not actually exist. This results in generating an invalid measures structure.

K>> data{4}

ans = 

  struct with fields:

       name: 'rd.nii.gz'
     folder: '/home/hayashis/syncthing/git/app-tractanalysisprofiles/testdata/tensor'
       date: '04-Apr-2020 20:31:58'
      bytes: 944065
      isdir: 0
    datenum: 7.3789e+05

K>> data{5}

ans = 

  0×1 empty struct array with fields:

    name
    folder
    date
    bytes
    isdir
    datenum

This then leads to the following error

Error using strlength (line 28)
Not enough input arguments.

Error in build_nifti_data (line 5)


Error in main (line 78)

I believe the main.m's if statement should be updated to actually look for the existence of the nii.gz as (ga,ak,mk,rk) are optional files within tensor datatype, so they might not exist at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant