Skip to content

Commit

Permalink
Merge pull request #5 from ftdc-picsl/longitudinal
Browse files Browse the repository at this point in the history
Longitudinal processing
  • Loading branch information
cookpa committed Oct 30, 2023
2 parents 5b654d9 + 94e86df commit 633c1b1
Show file tree
Hide file tree
Showing 6 changed files with 596 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ENV ANTSPATH="/opt/ants/bin/" \
LD_LIBRARY_PATH="/opt/ants/lib:$LD_LIBRARY_PATH"

RUN mkdir -p /opt/scripts
COPY runAntsCT_nonBIDS.pl /opt/scripts/runAntsCT_nonBIDS.pl
COPY run*.pl /opt/scripts/
COPY trim_neck.sh /opt/scripts/trim_neck.sh
# BIDS script when it's ready to use
# COPY runANTsCT.py /opt/scripts/runANTsCT.py
Expand All @@ -35,4 +35,4 @@ WORKDIR /data
# ENTRYPOINT ["/opt/scripts/runANTsCT.py"]
#
# For now, use a legacy interface
ENTRYPOINT ["/opt/scripts/runAntsCT_nonBIDS.pl"]
ENTRYPOINT ["/opt/scripts/run.pl"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ Custom labels defined at run time must be aligned to the MNI152NLin2009cAsym
template in templateflow v1.4.1.


## Running the container

```
# For cross-sectional processing
docker run --rm -it cookpa/antsct-aging:0.4.1 --help
# For longitudinal processing
docker run --rm -it cookpa/antsct-aging:0.4.1 --help --longitudinal
```


## References

For ANTs cortical thickness: [Tustison, et al 2014](http://dx.doi.org/10.1016/j.neuroimage.2014.05.044).
Expand Down
43 changes: 43 additions & 0 deletions run.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/perl -w
#
# Wrapper script, just figures out if longitudinal and then runs
# the appropriate script.

use strict;
use Getopt::Long;

my $runLongitudinal = 0;

if ($#ARGV < 0) {
print qq{
antsct-aging run script
For help, run with "--help" or "--longitudinal --help".
};

exit 1;
}

my $printHelp = 0;

Getopt::Long::Configure("pass_through");

GetOptions("help" => \$printHelp,
"longitudinal" => \$runLongitudinal);


if ($printHelp) {
if ($runLongitudinal) {
system("/opt/scripts/runAntsLongCT_nonBIDS.pl --help");
} else {
system("/opt/scripts/runAntsCT_nonBIDS.pl --help");
}
exit 0;
}

if ($runLongitudinal) {
system("/opt/scripts/runAntsLongCT_nonBIDS.pl --longitudinal @ARGV");
} else {
system("/opt/scripts/runAntsCT_nonBIDS.pl @ARGV");
}
1 change: 1 addition & 0 deletions runAntsCT_nonBIDS.pl
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
"brain-mask-image=s" => \$brainMaskImage,
"brain-mask-mode=s" => \$brainMaskMode,
"denoise=i" => \$denoise,
"help" => sub { print $usage; exit(0); },
"keep-files=i" => \$keepTmp,
"mni-cortical-labels=s{1,}" => \@userMNICorticalLabels,
"mni-labels=s{1,}" => \@userMNILabels,
Expand Down
Loading

0 comments on commit 633c1b1

Please sign in to comment.