Skip to content

Instantly share code, notes, and snippets.

@jcfr
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcfr/367bd37e8d5b5c78b0d0 to your computer and use it in GitHub Desktop.
Save jcfr/367bd37e8d5b5c78b0d0 to your computer and use it in GitHub Desktop.
Collection of shell script useful to maintain Slicer legacy modules. Originally created while working on Slicer issue #3401
#
# This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
#
# Script licensed under BSD style license, with extensions to cover
# contributions and other issues specific to 3D Slicer.
# See http://www.slicer.org/pages/LicenseText file for details.
#
for i in \
AffineRegistration \
BSplineDeformableRegistration \
LinearRegistration \
RigidRegistration \
MRIBiasFieldCorrection \
MultiResolutionAffineRegistration \
OtsuThresholdImageFilter \
OtsuThresholdSegmentation;
do \
cd ./Slicer-$i
# Get metadata
title="$(xmllint --nocdata --xpath "/executable/title/text()" ./$i/$i.xml)"
titlesize=${#title}
titlesep="$(for i in $(seq $titlesize); do echo -n '='; done)"
desc="$(xmllint --nocdata --xpath "/executable/description/text()" ./$i/$i.xml)"
acknowledgements="$(xmllint --nocdata --xpath "/executable/acknowledgements/text()" ./$i/$i.xml)"
contributors="$(xmllint --nocdata --xpath "/executable/contributor/text()" ./$i/$i.xml)"
[ -z "$desc" ] && desc=NA
[ -z "$acknowledgements" ] && acknowledgements=NA
[ -z "$contributors" ] && contributors=NA
echo "$title
$titlesep
This module is _NOT_ actively supported or maintained (See [#3401](http://na-mic.org/Mantis/view.php?id=3401)).
The associated code has been copied from Slicer [r23589](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=23589)
Note also the code will _NOT_ compile is its current state. The CMakeLists.txt
will have to be tweaked.
Description
-----------
$desc
Contributors
------------
$contributors
Acknowledgements
----------------
$acknowledgements
Licensing
---------
Materials in this repository are distributed under the following licenses:
* All software is licensed under BSD style license, with extensions to cover
contributions and other issues specific to 3D Slicer.
See License.txt file for details." > README.md
git add README.md
git commit -m "Add README
The README file has been automatically generated using https://gist.github.com/jcfr/367bd37e8d5b5c78b0d0
"
git push origin master
cd ..
done
for i in \
AffineRegistration \
BSplineDeformableRegistration \
LinearRegistration \
RigidRegistration \
MRIBiasFieldCorrection \
MultiResolutionAffineRegistration \
OtsuThresholdImageFilter \
OtsuThresholdSegmentation;
do \
cd ./Slicer-$i
# Get metadata
title="$(xmllint --nocdata --xpath "/executable/title/text()" ./$i/$i.xml)"
titlesize=${#title}
titlesep="$(for i in $(seq $titlesize); do echo -n '='; done)"
desc="$(xmllint --nocdata --xpath "/executable/description/text()" ./$i/$i.xml)"
acknowledgements="$(xmllint --nocdata --xpath "/executable/acknowledgements/text()" ./$i/$i.xml)"
contributors="$(xmllint --nocdata --xpath "/executable/contributor/text()" ./$i/$i.xml)"
[ -z "$desc" ] && desc=NA
[ -z "$acknowledgements" ] && acknowledgements=NA
[ -z "$contributors" ] && contributors=NA
echo "$title
$titlesep
This module is _NOT_ actively supported or maintained (See [#3401](http://na-mic.org/Mantis/view.php?id=3401)).
The associated code has been copied from Slicer [r23589](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=23589)
Note also the code will _NOT_ compile is its current state. The CMakeLists.txt
will have to be tweaked.
Description
-----------
$desc
Contributors
------------
$contributors
Acknowledgements
----------------
$acknowledgements
Licensing
---------
Materials in this repository are distributed under the following licenses:
* All software is licensed under BSD style license, with extensions to cover
contributions and other issues specific to 3D Slicer.
See License.txt file for details." > README.md
git add README.md
git commit -m "Add README
The README file has been automatically generated using https://gist.github.com/jcfr/367bd37e8d5b5c78b0d0
"
git push origin master
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment