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

transform function does not adapt stage naming properly #260

Open
gdevenyi opened this issue Sep 10, 2019 · 0 comments
Open

transform function does not adapt stage naming properly #260

gdevenyi opened this issue Sep 10, 2019 · 0 comments

Comments

@gdevenyi
Copy link
Contributor

I have the following code snippit, as per discussion at #248

convert = {
  branch.name = "${branch.name}.convert"

  if(file(input).name.endsWith('.mnc')) {
        exec """
            mincconvert -2 -clobber -compress 9 $input.mnc $output.mnc
        """
  }
  else
  if(file(input).name.endsWith('.nii.gz')) {
      transform('.nii.gz') to('.convert.mnc') {
      exec """
          nii2mnc -clobber $input $output.mnc
      """
      }
  }
  else
  if(file(input).name.endsWith('.nii')) {
      transform('.nii') to('.convert.mnc') {
      exec """
          nii2mnc -clobber $input $output.mnc
      """
      }
  }
}

Providing the following inputs:

../GAD_1.mnc  ../GAD_2.nii  ../GAD_3.nii.gz

Results in the following output filenames:

nii2mnc -clobber ../GAD_2.nii GAD_2.convert.mnc
nii2mnc -clobber ../GAD_3.nii.gz GAD_3.convert.mnc
mincconvert -2 -clobber -compress 9 ../GAD_1.mnc GAD_1.convert.mnc

However the naming of the stages is incorrect:

# Stage convert (GAD_3.nii)
# Stage convert (GAD_2)
# Stage convert (GAD_1)

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