Closed njhunsak closed 2 years ago
This should be an ANTs issue, not ours:
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh: line 931: 134992 Aborted ${ANTSPATH}/ImageMath selection/$TDIM vol0.nii.gz TimeSeriesSubset ${IMAGESETVARIABLE} ${range} /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh: line 916: cd: selection/: No such file or directory ls: cannot access *.nii.gz: No such file or directory
You can look up ANTs GitHub--the original script name is antsMultivariateTemplateConstruction2.sh
.
I'm not sure it's an ANTs problem given that the input file listed doesn't exist:
(harmonization) tests $ ls /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/
(harmonization) tests $
There's no file named, antsMultCaselist.txt under the template directory. Therefore, when I run the command I get the error because it can't find any files, since there's no input information.
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh \
-d 3 -g 0.2 -k 2 -t BSplineSyN[0.1,26,0] -r 1 -c 2 -j 64 -f 8x4x2x1 \
-o /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/ \
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
I think this is an issue with the harmonization.py script since this part of the script doesn't result in a file being created: https://github.com/pnlbwh/dMRIharmonization/blob/2a1001d8ef34b50ac647297267a8a34d47cebe1e/lib/harmonization.py#L213-L214
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/
Does the executor have write permission inside above?
Check if connectom_prisma
has unzipped properly:
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/
Try touch antsMultCaselist.txt
inside template/
In addition to @tashrifbillah's suggestions: @njhunsak - Can you please check if the folders harm and dti empty? Can I access this path (/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/) using David's computer?
touch antsMultCaselist.txt
inside the template/
directory and then re-run the command, ./pipeline_test.sh
the file gets deleted.@njhunsak - I checked the path but it does not exist for me. Let's make sure that we set up the harmonization to a common folder or I have permission to access the folder.
@suheyla2 please try that path again.
Still, no success! I will send an email to Tracy.
Unless David's account isn't part of the wilde group? I have permissions open on the apps directory:
$ ls -la /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/
drwxrwxrwx 24 u0243256 wilde 4096 Mar 15 07:35 .
drwxrwxr-x 9 root wilde 141 Feb 22 11:36 ..
[...]
drwxrwxrwx 6 u0243256 wilde 216 Mar 9 13:25 dMRIharmonization
Can you reattempt the clone and test in your $HOME
?
Same error running from $HOME. I even reinstalled ANTs to make sure I have the latest version. From what I can tell, antsMultivariateTemplateConstruction2_fixed_random_seed.sh
requires that the images being used for the template have to all be in the same folder and the script should be submitted from that directory. It says so in the usage information:
Usage:
antsMultivariateTemplateConstruction2_fixed_random_seed.sh -d ImageDimension -o OutputPrefix
<other options> <images>
Compulsory arguments (minimal command line requires SGE/PBS cluster, otherwise use -c and
-j options):
-d: ImageDimension: 2 or 3 (for 2 or 3 dimensional registration of single volume)
ImageDimension: 4 (for template generation of time-series data)
<images> List of images in the current directory, eg *_t1.nii.gz. Should be at the end
of the command. Optionally, one can specify a .csv or .txt file where each
line is the location of the input image. One can also specify more than
one file for each image for multi-modal template construction (e.g. t1 and t2).
For the multi-modal case, the templates will be consecutively numbered (e.g.
template0.nii.gz, template1.nii.gz, ...).
NB: All images to be added to the template should be in the same directory, and this
script should be invoked from that directory.
[...]
From your code, in it appears that the images are kept in their original directories and a text file with full path names is generated. This won't work with antsMultivariateTemplateConstruction2_fixed_random_seed.sh
and that's why I get my original error that ANTs can't find any images to use to generate a template.
If I copy the these files to the template directory:
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dti/dwi_A_connectom_st_b1200_bmapped_resampled_FA.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_A_connectom_st_b1200_bmapped_resampled_FA.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/harm/dwi_A_connectom_st_b1200_bmapped_resampled_L0.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_A_connectom_st_b1200_bmapped_resampled_L0.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/dti/dwi_B_connectom_st_b1200_bmapped_resampled_FA.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_B_connectom_st_b1200_bmapped_resampled_FA.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/harm/dwi_B_connectom_st_b1200_bmapped_resampled_L0.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_B_connectom_st_b1200_bmapped_resampled_L0.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/dti/dwi_C_connectom_st_b1200_bmapped_resampled_FA.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_C_connectom_st_b1200_bmapped_resampled_FA.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/harm/dwi_C_connectom_st_b1200_bmapped_resampled_L0.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_C_connectom_st_b1200_bmapped_resampled_L0.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/dti/dwi_A_prisma_st_b1200_bmapped_resampled_FA.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_A_prisma_st_b1200_bmapped_resampled_FA.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/harm/dwi_A_prisma_st_b1200_bmapped_resampled_L0.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_A_prisma_st_b1200_bmapped_resampled_L0.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/dti/dwi_B_prisma_st_b1200_bmapped_resampled_FA.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_B_prisma_st_b1200_bmapped_resampled_FA.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/harm/dwi_B_prisma_st_b1200_bmapped_resampled_L0.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_B_prisma_st_b1200_bmapped_resampled_L0.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/dti/dwi_C_prisma_st_b1200_bmapped_resampled_FA.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_C_prisma_st_b1200_bmapped_resampled_FA.nii.gz
cp -v ~/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/harm/dwi_C_prisma_st_b1200_bmapped_resampled_L0.nii.gz ~/dMRIharmonization/lib/tests/connectom_prisma/template/dwi_C_prisma_st_b1200_bmapped_resampled_L0.nii.gz
And create the antsMultCaselist.txt
in the template directory:
vi ~/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
with the following added to the text file:
dwi_A_connectom_st_b1200_bmapped_resampled_FA.nii.gz,dwi_A_connectom_st_b1200_bmapped_resampled_L0.nii.gz
dwi_B_connectom_st_b1200_bmapped_resampled_FA.nii.gz,dwi_B_connectom_st_b1200_bmapped_resampled_L0.nii.gz
dwi_C_connectom_st_b1200_bmapped_resampled_FA.nii.gz,dwi_C_connectom_st_b1200_bmapped_resampled_L0.nii.gz
dwi_A_prisma_st_b1200_bmapped_resampled_FA.nii.gz,dwi_A_prisma_st_b1200_bmapped_resampled_L0.nii.gz
dwi_B_prisma_st_b1200_bmapped_resampled_FA.nii.gz,dwi_B_prisma_st_b1200_bmapped_resampled_L0.nii.gz
dwi_C_prisma_st_b1200_bmapped_resampled_FA.nii.gz,dwi_C_prisma_st_b1200_bmapped_resampled_L0.nii.gz
Then, this command runs just fine:
cd ~/dMRIharmonization/lib/tests/connectom_prisma/template/
~/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh \
-d 3 -g 0.2 -k 2 -t BSplineSyN[0.1,26,0] -r 1 -c 2 -j 104 -f 8x4x2x1 \
antsMultCaselist.txt
I'm going to guess that dMRIharmonization is installed correctly since all the other checks worked just fine.
This won't work with antsMultivariateTemplateConstruction2_fixed_random_seed.sh and that's why I get my original error
./pipeline_test.sh
is a long-standing and trusted test that has proven to be robust across many environments.
I even reinstalled ANTs to make sure I have the latest version.
I wonder if that is the culprit. I know a few things have changed in ANTs and we have tested using v2.3.0 only.
I installed ANTs v2.2.0 and the same issue persists (see log: pipelinetest.log).
I ran the other check listed, python -m unittest discover -v lib/tests/
, and that works fine (see log:
unittest.log.
If I create the antsMultCaselist.txt
myself and put the absolute path of the files:
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dti/dwi_A_connectom_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/harm/dwi_A_connectom_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/dti/dwi_B_connectom_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/harm/dwi_B_connectom_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/dti/dwi_C_connectom_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/harm/dwi_C_connectom_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/dti/dwi_A_prisma_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/harm/dwi_A_prisma_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/dti/dwi_B_prisma_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/harm/dwi_B_prisma_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/dti/dwi_C_prisma_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/harm/dwi_C_prisma_st_b1200_bmapped_resampled_L0.nii.gz
And run this command from the template directory, I get the same error:
cd /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh \
-d 3 -g 0.2 -k 2 -t BSplineSyN[0.1,26,0] -r 1 -c 2 -j 64 -f 8x4x2x1 \
-o /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/ \
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
However, if I run this command from the template directory, it runs just fine:
cd /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh \
-d 3 -g 0.2 -k 2 -t BSplineSyN[0.1,26,0] -r 1 -c 2 -j 64 -f 8x4x2x1 \
-o /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/ \
antsMultCaselist.txt
Notice that in order for antsMultivariateTemplateConstruction2_fixed_random_seed.sh
to run correctly, I have to use only the antsMultCaselist.txt
and not the absolute path? There's a reason for that and is based on why ANTs says to invoke commands from the template directory:
I've used antsMultivariateTemplateConstruction2.sh
previously outside of your pipeline and I know the program is very particular about the location of files, from what directory the command is submitted, and use of absolute paths. I've now shown two ways to get antsMultivariateTemplateConstruction2_fixed_random_seed.sh
to run correctly.
antsMultCaselist.txt
and submit code from the template directory.antsMultCaselist.txt
and submit the code from the template directory.In order to invoke the antsMultivariateTemplateConstruction2_fixed_random_seed.sh
command, you have to be in the template directory that contains the antsMultCaselist.txt
file. It doesn't run if you use the absolute path to antsMultCaselist.txt
even if you are in the template directory. I'll show you why :
If you set IMAGESETVARIABLE
to equal the absolute path on my system, /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
, then when the program tries to extract the extension with echo ${IMAGESETVARIABLE#*.}
, the value will always be wrong. In my case the extension
variable is set to utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
and that doesn't equal txt
or csv
. That's why I can't run the code from the harmonzation.py
script.
So instead, if IMAGESETVARIABLE
equals just antsMultCaselist.txt
, which excludes the absolute path, the extension
variable is now set to txt
as it suppose to be set and everything runs just fine.
Any period anywhere in the absolute path is going to lead to issues based on the ANTs script. Could you update these lines in the harmonization.py
and anywhere else in your code to be more compatible with the ANTs code and more universal for other systems?
What does uname -a
say?
~ $ uname -a
Linux notchpeak2 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
@njhunsak - Thanks for reporting this. I wonder if there is another location where you can set up the pipeline that does not include dots in the absolute path? We have not observed this issue in the past since this type of path (chpc.utah.edu
) is not common. We can note this, though. However, since the deadline is approaching and I do not have access to your data, this might be a better option.
@suheyla2 Having dots in pathnames is actually common. I've worked with nearly a dozen HPC systems and many have their base URL like this in their pathname. If they happen to not use their URL in the pathname, then I've had systems set usernames as the last name dot first name (hunsaker.naomi
). Unfortunately, I can't control how the university sets its login and system name. This is an issue that will need to be addressed in the code instead.
Do:
cd dMRIharmonization
git pull origin dotted-path
cd lib/tests/
./pipeline_test.sh
and let us know your finding.
The pipeline_test.sh
is still using the absolute path to the antsMultCaselist.txt
file, which results in a error when trying to run antsMultivariateTemplateConstruction2_fixed_random_seed.sh
:
subprocess.CalledProcessError: Command '/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh -d 3 -g 0.2 -k 2 -t BSplineSyN[0.1,26,0] -r 1 -c 2 -j 104 -f 8x4x2x1 -o /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/ /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt' returned non-zero exit status 1.
harmonization.py with --create --process --debug failed
I did confirm the new code in the buildTemplate.py
script:
def antsMult(caselist, outPrefix):
N_core=getenv('TEMPLATE_CONSTRUCT_CORES')
# launch antsMultivariateTemplateConstruction2.sh from within template directory
# https://github.com/pnlbwh/dMRIharmonization/issues/80
with local.cwd(dirname(caselist)):
check_call((' ').join([pjoin(SCRIPTDIR, 'antsMultivariateTemplateConstruction2_fixed_random_seed.sh'),
'-d', '3',
'-g', '0.2',
'-k', '2',
'-t', "BSplineSyN[0.1,26,0]",
'-r', '1',
'-c', '2',
'-j', str(N_core) if N_core else str(N_proc),
'-f', '8x4x2x1',
'-o', outPrefix,
caselist]), shell= True)
The only way antsMultivariateTemplateConstruction2_fixed_random_seed.sh
will run correctly is if the command is submitted from within the template directory AND the text file that contains the list of images is submitted with NO path (e.g., antsMultCaselist.txt
). The command needs to look like this when submitted:
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh \
-d 3 -g 0.2 -k 2 -t BSplineSyN[0.1,26,0] -r 1 -c 2 -j 104 -f 8x4x2x1 \
-o /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/ \
antsMultCaselist.txt
The pipeline_test.sh is still using the absolute path to the antsMultCaselist.txt file, which results in a error
The above comment is contradictory to what was asked before:
- List files with absolute path in antsMultCaselist.txt and submit the code from the template directory.
We followed that ask and provided a fix.
the text file that contains the list of images is submitted with NO path (e.g., antsMultCaselist.txt)
Clarify list of images
and NO path
. The two phrases are contradictory.
The antsMultCaselist.txt
can contain the absolute path to the list of images. The command that submits antsMultCaselist.txt
should not contain any path information. As I've explained above:
Create antsMultCaselist.txt
in the template directory:
vi ~/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
Copy and paste the list of images with absolute path information:
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dti/dwi_A_connectom_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/harm/dwi_A_connectom_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/dti/dwi_B_connectom_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/harm/dwi_B_connectom_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/dti/dwi_C_connectom_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/harm/dwi_C_connectom_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/dti/dwi_A_prisma_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/harm/dwi_A_prisma_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/dti/dwi_B_prisma_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/harm/dwi_B_prisma_st_b1200_bmapped_resampled_L0.nii.gz
/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/dti/dwi_C_prisma_st_b1200_bmapped_resampled_FA.nii.gz,/uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/harm/dwi_C_prisma_st_b1200_bmapped_resampled_L0.nii.gz
Change into the template
directory to submit antsMultivariateTemplateConstruction2_fixed_random_seed.sh
:
cd /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/
Submit the following command with absolute path to antsMultCaselist.txt
:
/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh \
-d 3 -g 0.2 -k 2 -t BSplineSyN[0.1,26,0] -r 1 -c 2 -j 104 -f 8x4x2x1 \
-o /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/ \
antsMultCaselist.txt
The command that submits antsMultCaselist.txt should not contain any path information.
Where does it now?
I explained previously that the absolute path to antsMultCaselist.txt
cannot be used when submitting antsMultivariateTemplateConstruction2_fixed_random_seed.sh
:
If you set
IMAGESETVARIABLE
to equal the absolute path on my system,/uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
, then when the program tries to extract the extension withecho ${IMAGESETVARIABLE#*.}
, the value will always be wrong. In my case theextension
variable is set toutah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/antsMultCaselist.txt
and that doesn't equaltxt
orcsv
. That's why I can't run the code from theharmonzation.py
script.So instead, if
IMAGESETVARIABLE
equals justantsMultCaselist.txt
, which excludes the absolute path, theextension
variable is now set totxt
as it suppose to be set and everything runs just fine.
The last screenshot helps.
Interestingly, it does work for me!
Suheyla is right. Regardless, please retry https://github.com/pnlbwh/dMRIharmonization/issues/80#issuecomment-1081434801
basename()
was the change neededThank you for making this change based on my feedback since it fixes the issue of antsMultivariateTemplateConstruction2_fixed_random_seed.sh
not wanting to run.
By using only the file name and not including the full path, ANTs can identify the file correctly.
Once I got the code running on my system, it took ~13 hours to run the pipeline_test.sh
because parallelization was hardcoded in the antsMultivariateTemplateConstruction2_fixed_random_seed.sh
command.
As a suggestion, it would be helpful to have the same options that ANTs provides when submitting the harmonzation.py
command, so the end-user doesn't have to hunt through the code and manually change the parameters:
-c: Control for parallel computation (default 0):
0 = run serially
1 = SGE qsub
2 = use PEXEC (localhost)
3 = Apple XGrid
4 = PBS qsub
5 = SLURM
The University of Utah CHPC system uses SLURM (v20.11.5) for job scheduling. When I changed '-c', '2',
to '-c', '5',
the process then only took 2 hours.
With the code running correctly now, here are the results from our system:
04/02/22 03:05,mean meanFA,std meanFA
CONNECTOM,0.6888020758415321,0.010355104431533755
PRISMA_before,0.819265744652604,0.006880781750666151
PRISMA_after,0.6887081881685634,0.010201016058496677
The values aren't exactly the same as the table shown on Github. Is that OK?
02/24/20 11:37,mean meanFA,std meanFA
CONNECTOM,0.6799002461759734,0.007886013534889139
PRISMA_before,0.8016994786111754,0.010304926419301603
PRISMA_after,0.6763777736686049,0.010977445592601354
And here's the template/meanFAstat_ebarplot.png
image:
Thank you for confirming. I apologize for not clearly informing you about my basename()
change last time.
because parallelization was hardcoded in the
We only work on localhost and so our program is set for -c 2
and -j all_available
. Again, we do not have SLURM (-c 5
). I shall have to think how to allow a variable -c
from the command line. But it seems that you got it optimized for your system already. Regardless, you might benefit from reading https://github.com/pnlbwh/dMRIharmonization#multi-threading .
I've installed this pipeline and was attempting to verify the installation was done correctly. Here's the output when I ran the pipeline_test.sh. The program antsMultivariateTemplateConstruction2_fixed_random_seed.sh is looking for a directory, selection, that does not exist. Do I need to include more information when I run ./pipeline_test.sh?
output log
``` (harmonization) tests $ ./pipeline_test.sh connectom_prisma/ connectom_prisma/connectom/ connectom_prisma/connectom/A/ connectom_prisma/connectom/A/dwi_A_connectom_st_b1200.bval connectom_prisma/connectom/A/dwi_A_connectom_st_b1200.bvec connectom_prisma/connectom/A/dwi_A_connectom_st_b1200_mask.nii.gz connectom_prisma/connectom/A/dwi_A_connectom_st_b1200.nii.gz connectom_prisma/connectom/B/ connectom_prisma/connectom/B/dwi_B_connectom_st_b1200.bval connectom_prisma/connectom/B/dwi_B_connectom_st_b1200.bvec connectom_prisma/connectom/B/dwi_B_connectom_st_b1200_mask.nii.gz connectom_prisma/connectom/B/dwi_B_connectom_st_b1200.nii.gz connectom_prisma/connectom/C/ connectom_prisma/connectom/C/dwi_C_connectom_st_b1200.bval connectom_prisma/connectom/C/dwi_C_connectom_st_b1200.bvec connectom_prisma/connectom/C/dwi_C_connectom_st_b1200_mask.nii.gz connectom_prisma/connectom/C/dwi_C_connectom_st_b1200.nii.gz connectom_prisma/prisma/ connectom_prisma/prisma/A/ connectom_prisma/prisma/A/dwi_A_prisma_st_b1200.bval connectom_prisma/prisma/A/dwi_A_prisma_st_b1200.bvec connectom_prisma/prisma/A/dwi_A_prisma_st_b1200_mask.nii.gz connectom_prisma/prisma/A/dwi_A_prisma_st_b1200.nii.gz connectom_prisma/prisma/B/ connectom_prisma/prisma/B/dwi_B_prisma_st_b1200.bval connectom_prisma/prisma/B/dwi_B_prisma_st_b1200.bvec connectom_prisma/prisma/B/dwi_B_prisma_st_b1200_mask.nii.gz connectom_prisma/prisma/B/dwi_B_prisma_st_b1200.nii.gz connectom_prisma/prisma/C/ connectom_prisma/prisma/C/dwi_C_prisma_st_b1200.bval connectom_prisma/prisma/C/dwi_C_prisma_st_b1200.bvec connectom_prisma/prisma/C/dwi_C_prisma_st_b1200_mask.nii.gz connectom_prisma/prisma/C/dwi_C_prisma_st_b1200.nii.gz connectom_prisma/connectom.txt connectom_prisma/prisma.txt Determining maximum possible order of spherical harmonics for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dwi_A_connectom_st_b1200.bval Maximum possible order is 2 for 13 non-zero gradients Verifying /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dwi_A_connectom_st_b1200.bval is single shell ... b-shell bvalues [ 0. 1200.] Indices corresponding to b-shell 0.0 [ 0 8 15] Indices corresponding to b-shell 1200.0 [ 1 2 3 4 5 6 7 9 10 11 12 13 14] Verifying suitability of spherical harmonics order 2 for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dwi_A_connectom_st_b1200.bval Determining maximum possible order of spherical harmonics for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dwi_A_connectom_st_b1200.bval Maximum possible order is 2 for 13 non-zero gradients Spherical harmonics order 2 is suitable, continuing Verifying /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/dwi_B_connectom_st_b1200.bval is single shell ... b-shell bvalues [ 0. 1200.] Indices corresponding to b-shell 0.0 [ 0 8 15] Indices corresponding to b-shell 1200.0 [ 1 2 3 4 5 6 7 9 10 11 12 13 14] Verifying suitability of spherical harmonics order 2 for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/dwi_B_connectom_st_b1200.bval Determining maximum possible order of spherical harmonics for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/dwi_B_connectom_st_b1200.bval Maximum possible order is 2 for 13 non-zero gradients Spherical harmonics order 2 is suitable, continuing Verifying /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/dwi_C_connectom_st_b1200.bval is single shell ... b-shell bvalues [ 0. 1200.] Indices corresponding to b-shell 0.0 [ 0 8 15] Indices corresponding to b-shell 1200.0 [ 1 2 3 4 5 6 7 9 10 11 12 13 14] Verifying suitability of spherical harmonics order 2 for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/dwi_C_connectom_st_b1200.bval Determining maximum possible order of spherical harmonics for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/dwi_C_connectom_st_b1200.bval Maximum possible order is 2 for 13 non-zero gradients Spherical harmonics order 2 is suitable, continuing Verifying /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/dwi_A_prisma_st_b1200.bval is single shell ... b-shell bvalues [ 0. 1200.] Indices corresponding to b-shell 0.0 [ 0 8 15] Indices corresponding to b-shell 1200.0 [ 1 2 3 4 5 6 7 9 10 11 12 13 14] Verifying suitability of spherical harmonics order 2 for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/dwi_A_prisma_st_b1200.bval Determining maximum possible order of spherical harmonics for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/dwi_A_prisma_st_b1200.bval Maximum possible order is 2 for 13 non-zero gradients Spherical harmonics order 2 is suitable, continuing Verifying /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/dwi_B_prisma_st_b1200.bval is single shell ... b-shell bvalues [ 0. 1200.] Indices corresponding to b-shell 0.0 [ 0 8 15] Indices corresponding to b-shell 1200.0 [ 1 2 3 4 5 6 7 9 10 11 12 13 14] Verifying suitability of spherical harmonics order 2 for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/dwi_B_prisma_st_b1200.bval Determining maximum possible order of spherical harmonics for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/dwi_B_prisma_st_b1200.bval Maximum possible order is 2 for 13 non-zero gradients Spherical harmonics order 2 is suitable, continuing Verifying /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/dwi_C_prisma_st_b1200.bval is single shell ... b-shell bvalues [ 0. 1200.] Indices corresponding to b-shell 0.0 [ 0 8 15] Indices corresponding to b-shell 1200.0 [ 1 2 3 4 5 6 7 9 10 11 12 13 14] Verifying suitability of spherical harmonics order 2 for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/dwi_C_prisma_st_b1200.bval Determining maximum possible order of spherical harmonics for /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/dwi_C_prisma_st_b1200.bval Maximum possible order is 2 for 13 non-zero gradients Spherical harmonics order 2 is suitable, continuing /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/dti exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/A/harm exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/dti exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/B/harm exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/dti exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/connectom/C/harm exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/dti exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/A/harm exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/dti exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/B/harm exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/dti exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/../../harmonization.py:63: UserWarning: /uufs/chpc.utah.edu/common/home/u0243256/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/prisma/C/harm exists, --force not specified, continuing with existing directory warnings.warn(f'{path} exists, --force not specified, continuing with existing directory') terminate called after throwing an instance of 'std::invalid_argument' what(): stoi /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh: line 931: 134992 Aborted ${ANTSPATH}/ImageMath selection/$TDIM vol0.nii.gz TimeSeriesSubset ${IMAGESETVARIABLE} ${range} /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/antsMultivariateTemplateConstruction2_fixed_random_seed.sh: line 916: cd: selection/: No such file or directory ls: cannot access *.nii.gz: No such file or directory -------------------------------------------------------------------------------------- Multivariate template construction using the following 2-tuples: -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- Creating template /uufs/chpc.utah.edu/common/home/tbicc-group1/apps/dMRIharmonization/lib/tests/connectom_prisma/template/template0.nii.gz from a population average image from the inputs. -------------------------------------------------------------------------------------- Usage: AverageImages ImageDimension Outputfname.nii.gz Normalize