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

Perfusion-related fixes (PHI, PerfusionPCA, GUI/CLI) #1476

Merged
10 changes: 7 additions & 3 deletions 3_HowToGuides.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/dicomFolderWithSingleSubject -o

/**
\page preprocessing_reg Image Co-registration
This tool registers multiple moving images to a single target image using the Greedy Registration technique [1].
This tool registers multiple moving images to a single target image using the Greedy Registration technique [1].
This tool is also available from the web on the [CBICA Image Processing Portal](https://ipp.cbica.upenn.edu/). Please see the experiment on the portal for details.
<b>REQUIREMENTS:</b>
-# A Target image.
Expand Down Expand Up @@ -560,6 +560,10 @@ This application evaluates the Epidermal Growth Factor Receptor splice variant I
- This application is also available as with a stand-alone CLI for data analysts to build pipelines around, using the following example command:
\verbatim
${CaPTk_InstallDir}/bin/EGFRvIIISurrogateIndex.exe -i C:/inputDSCImage.nii.gz -m C:/maskWithNearAndFarLabels.nii.gz
\endverbatim
- Additionally, you can process a batch directory (subdirectories are subjects, and each must have a perfusion and mask image). Pass "--help" to the CLI application for more details.
\verbatim
${CaPTk_InstallDir}/bin/EGFRvIIISurrogateIndex.exe -b C:/inputDirectory/ -o C:/output.csv
\endverbatim

<b>RULES FOR ROI ANNOTATION</b>:
Expand Down Expand Up @@ -1074,11 +1078,11 @@ This application extracts the principal components from DSC-MRI scans as mention
<b> REQUIREMENTS:</b>
Directory containing the following images in a sub-folder:
-# A single DSC-MRI image (filename must contain the text 'perf' or 'PERF' or 'DSC' to be correctly detected e.g. AAAA_perf.nii.gz )
-# Its corresponding mask for which the measurements need to be extracted (filename must contain the text 'label' or 'segmentation'
-# Its corresponding mask for which the measurements need to be extracted (filename must contain the text 'label' or 'segmentation')
to be correctly detected e.g. AAA_label.nii.gz)
-# An example directory structure for the input data is as follows:
\verbatim
- RootFolder
- RootFolder (this is the one you select for input)
- Subject_AAAA
- AAAA_perf.nii.gz
- AAAA_label.nii.gz
Expand Down
300 changes: 150 additions & 150 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,193 +561,193 @@ jobs:
displayName: Uploading to NITRC
condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) )

- job: 'macOS_SelfHost_1014'
displayName: "Self-hosted agent on macOS 10.14"
timeoutInMinutes: 0
cancelTimeoutInMinutes: 300
# - job: 'macOS_SelfHost_1014'
# displayName: "Self-hosted agent on macOS 10.14"
# timeoutInMinutes: 0
# cancelTimeoutInMinutes: 300

pool: 'macOS_10.14_alt' # Change to alt pool to try running this outside of Phuc's account -- possible permissions problems
# pool: 'macOS_10.14_alt' # Change to alt pool to try running this outside of Phuc's account -- possible permissions problems

steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
# steps:
# - checkout: self # self represents the repo where the initial Pipelines YAML file was found

# submodule
- bash: |
export GIT_LFS_SKIP_SMUDGE=1
git submodule update --init --recursive
# # submodule
# - bash: |
# export GIT_LFS_SKIP_SMUDGE=1
# git submodule update --init --recursive

displayName: 'Git Submodule Init and Update'

# Moving LFS Files
- bash: |
rm -rf bin
mkdir -p bin
cd bin
wget https://github.com/CBICA/CaPTk/raw/master/binaries/precompiledApps/macos.zip -O binaries_macos.zip
wget https://github.com/CBICA/CaPTk/raw/master/binaries/qt_5.12.1/macos.zip -O qt.zip
# mv ../binaries/precompiledApps/macos.zip ./binaries_macos.zip
# mv ../binaries/qt_5.12.1/macos.zip ./qt.zip
ls -lt
displayName: 'Downloading & Moving LFS files to the appropriate location under bin'
# displayName: 'Git Submodule Init and Update'

# # Moving LFS Files
# - bash: |
# cd bin
# rm -rf bin
# mkdir -p bin
# cd bin
# wget https://github.com/CBICA/CaPTk/raw/master/binaries/precompiledApps/macos.zip -O binaries_macos.zip
# wget https://github.com/CBICA/CaPTk/raw/master/binaries/qt_5.12.1/macos.zip -O qt.zip
# # mv ../binaries/precompiledApps/macos.zip ./binaries_macos.zip
# # mv ../binaries/qt_5.12.1/macos.zip ./qt.zip
# ls -lt
# displayName: 'Downloading & Moving LFS files to the appropriate location under bin'

# export CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
# export CMAKE_PREFIX_PATH="/Library/TeX/texbin"
# # - bash: |
# # cd bin

# cmake ../ -DCMAKE_INSTALL_PREFIX="./install"
# # export CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
# # export CMAKE_PREFIX_PATH="/Library/TeX/texbin"

# make -j 2
# # cmake ../ -DCMAKE_INSTALL_PREFIX="./install"

# displayName: 'Configure and compile Superbuild'
# # make -j 2

# - bash: |
# # mkdir $(Build.SourcesDirectory)/../superbuild
# # cd bin
# # mv ./* $(Build.SourcesDirectory)/../superbuild
# # cd $(Build.SourcesDirectory)/..
# # ls
# # echo "Done cd"
# # tar cvfz superbuild.tar.gz superbuild
# # ls
# # echo "done tar"
# # rm -rf superbuild
# # ls
# # cd $(Build.SourcesDirectory)
# # displayName: 'Configure and compile Superbuild'

# pwd
# # - bash: |
# # # mkdir $(Build.SourcesDirectory)/../superbuild
# # # cd bin
# # # mv ./* $(Build.SourcesDirectory)/../superbuild
# # # cd $(Build.SourcesDirectory)/..
# # # ls
# # # echo "Done cd"
# # # tar cvfz superbuild.tar.gz superbuild
# # # ls
# # # echo "done tar"
# # # rm -rf superbuild
# # # ls
# # # cd $(Build.SourcesDirectory)

# cd $(Build.SourcesDirectory)/../../
# ls
# tar xvfz superbuild.tar.gz
# rm -rf superbuild.tar.gz
# cd $(Build.SourcesDirectory)/../../superbuild/bin
# ls
# echo "Done tar"
# displayName: 'Move superbuild and qt and compiled apps'
# # pwd

- bash: |
git pull origin master
git log -1
cat CMakeLists.txt | grep -i "PROJECT_VERSION"
displayName: 'Testing git pull and version'
# # cd $(Build.SourcesDirectory)/../../
# # ls
# # tar xvfz superbuild.tar.gz
# # rm -rf superbuild.tar.gz
# # cd $(Build.SourcesDirectory)/../../superbuild/bin
# # ls
# # echo "Done tar"
# # displayName: 'Move superbuild and qt and compiled apps'

- bash: |
cd bin
pwd
# - bash: |
# git pull origin master
# git log -1
# cat CMakeLists.txt | grep -i "PROJECT_VERSION"
# displayName: 'Testing git pull and version'

rm -rf CaPTk_*
# - bash: |
# cd bin
# pwd

export CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
export CMAKE_PREFIX_PATH=/Users/Shared/superbuild/ITK-build:/Users/Shared/superbuild/DCMTK-build:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core:$(pwd)/qt/5.12.1/clang_64/lib/cmake/Qt5:$(pwd)/qt/5.12.1/clang_64/lib/cmake/Qt5Core:$CMAKE_PREFIX_PATH
echo "[DEBUG] CMAKE_PREFIX_PATH: " $CMAKE_PREFIX_PATH
#cmake ../
#rm -f CMakeCache.txt
# rm -rf CaPTk_*

# export CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
# export CMAKE_PREFIX_PATH=/Users/Shared/superbuild/ITK-build:/Users/Shared/superbuild/DCMTK-build:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core:$(pwd)/qt/5.12.1/clang_64/lib/cmake/Qt5:$(pwd)/qt/5.12.1/clang_64/lib/cmake/Qt5Core:$CMAKE_PREFIX_PATH
# echo "[DEBUG] CMAKE_PREFIX_PATH: " $CMAKE_PREFIX_PATH
# #cmake ../
# #rm -f CMakeCache.txt

cmake -DITK_DIR="/Users/Shared/superbuild/ITK-build" -DDCMTK_DIR="/Users/Shared/superbuild/DCMTK-build" -DVTK_DIR="/Users/Shared/superbuild/VTK-build" -DCMAKE_INSTALL_PREFIX="./install" -DQt5_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5 -DQt5Core_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core ../
# cmake -DITK_DIR="/Users/Shared/superbuild/ITK-build" -DDCMTK_DIR="/Users/Shared/superbuild/DCMTK-build" -DVTK_DIR="/Users/Shared/superbuild/VTK-build" -DCMAKE_INSTALL_PREFIX="./install" -DQt5_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5 -DQt5Core_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core ../

# Debug using vsts' cache
cp CMakeCache.txt /Users/Shared/debug-vsts-getkaa-cmakecache.txt
make -j 2
# # Debug using vsts' cache
# cp CMakeCache.txt /Users/Shared/debug-vsts-getkaa-cmakecache.txt
# make -j 2

displayName: 'Configure and compile CaPTk'
# displayName: 'Configure and compile CaPTk'

- bash: |
cd bin
# - bash: |
# cd bin

version=$(grep -i -e "project_version:*" CMakeCache.txt | cut -c24-)
# version=$(grep -i -e "project_version:*" CMakeCache.txt | cut -c24-)

rm -rf CaPTk_$version.app/Contents/Resources/bin/ITK-SNAP.app
# rm -rf CaPTk_$version.app/Contents/Resources/bin/ITK-SNAP.app

rm -rf CaPTk*.app
# rm -rf CaPTk*.app

cmake ../
rm -f CMakeCache.txt
export CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
export CMAKE_PREFIX_PATH=/Users/Shared/superbuild/ITK-build:/Users/Shared/superbuild/DCMTK-build:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core:$CMAKE_PREFIX_PATH
# cmake ../
# rm -f CMakeCache.txt
# export CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
# export CMAKE_PREFIX_PATH=/Users/Shared/superbuild/ITK-build:/Users/Shared/superbuild/DCMTK-build:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5:/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core:$CMAKE_PREFIX_PATH


cmake -DITK_DIR="/Users/Shared/superbuild/ITK-build" -DDCMTK_DIR="/Users/Shared/superbuild/DCMTK-build" -DCMAKE_INSTALL_PREFIX="./install" -DQt5_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5 -DQt5Core_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core ../
# cmake -DITK_DIR="/Users/Shared/superbuild/ITK-build" -DDCMTK_DIR="/Users/Shared/superbuild/DCMTK-build" -DCMAKE_INSTALL_PREFIX="./install" -DQt5_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5 -DQt5Core_DIR=/Users/Shared/superbuild/qt/5.12.1/clang_64/lib/cmake/Qt5Core ../

make -j 2
# make -j 2

displayName: 'Ensure documentation is picked up properly'
# displayName: 'Ensure documentation is picked up properly'


- bash: |
cd bin
# - bash: |
# cd bin

version=$(grep -i -e "project_version:*" CMakeCache.txt | cut -c24-)
pkgname="_Installer"
pkgname="$version$pkgname"
# version=$(grep -i -e "project_version:*" CMakeCache.txt | cut -c24-)
# pkgname="_Installer"
# pkgname="$version$pkgname"

rm -rf *.pkg
rm -rf install_manifest.txt
make package
# rm -rf *.pkg
# rm -rf install_manifest.txt
# make package

# print dir tree for debug
ls -R _CPack_Packages
# # print dir tree for debug
# ls -R _CPack_Packages

pkgpath=""
if [ -d "$(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/ALL_IN_ONE/CaPTk_$version.app/" ]; then pkgpath="$(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/ALL_IN_ONE/CaPTk_$version.app/"; else pkgpath="$(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/CaPTk_$version.app/"; fi
# pkgpath=""
# if [ -d "$(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/ALL_IN_ONE/CaPTk_$version.app/" ]; then pkgpath="$(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/ALL_IN_ONE/CaPTk_$version.app/"; else pkgpath="$(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/CaPTk_$version.app/"; fi

# Try patching Utilities as late as possible. Seems to be necessary for Utilities specifically.
install_name_tool -change /usr/local/opt/libomp/lib/libomp.dylib @rpath/libomp.dylib $pkgpath/Contents/Resources/bin/Utilities
# # Try patching Utilities as late as possible. Seems to be necessary for Utilities specifically.
# install_name_tool -change /usr/local/opt/libomp/lib/libomp.dylib @rpath/libomp.dylib $pkgpath/Contents/Resources/bin/Utilities

pkgbuild --version $version --identifier com.cbica.captk --install-location /Applications --component $pkgpath ./CaPTk_$version.pkg

productbuild --synthesize --package CaPTk_$version.pkg ./distribution.xml

xml='<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>CaPTk_'"$version"'</title>
<license file="Combined.txt"></license>
<pkg-ref id="com.cbica.captk"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="com.cbica.captk"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.cbica.captk" visible="false">
<pkg-ref id="com.cbica.captk"/>
</choice>
<pkg-ref id="com.cbica.captk" version="$version" onConclusion="none">CaPTk_'"$version"'.pkg</pkg-ref>
</installer-gui-script>'

echo $xml > "./distribution.xml"

productbuild --distribution ./distribution.xml --resources $(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/ALL_IN_ONE/CaPTk_$version.app/Contents/Resources/license/ --package-path . ./CaPTk_$pkgname.pkg

mv *_Installer* $(Build.ArtifactStagingDirectory)

displayName: 'Package CaPTk (.dmg and .pkg)'

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: '$(Build.DefinitionName)_installer_macOS'

- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '$(Build.DefinitionName)_installer_macOS'
downloadPath: '$(System.ArtifactsDirectory)'

- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: cbicaNITRC
sourceFolder: $(Build.ArtifactStagingDirectory)
contents: '*_Installer.*'
targetFolder: /var/home/groups/captk/htdocs # previously /mnt/gforge-data/gforge/home/groups/captk/downloads
cleanTargetFolder: false
overwrite: true
continueOnError: true
displayName: Uploading to NITRC
condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) )
# pkgbuild --version $version --identifier com.cbica.captk --install-location /Applications --component $pkgpath ./CaPTk_$version.pkg

# productbuild --synthesize --package CaPTk_$version.pkg ./distribution.xml

# xml='<?xml version="1.0" encoding="utf-8"?>
# <installer-gui-script minSpecVersion="1">
# <title>CaPTk_'"$version"'</title>
# <license file="Combined.txt"></license>
# <pkg-ref id="com.cbica.captk"/>
# <options customize="never" require-scripts="false"/>
# <choices-outline>
# <line choice="default">
# <line choice="com.cbica.captk"/>
# </line>
# </choices-outline>
# <choice id="default"/>
# <choice id="com.cbica.captk" visible="false">
# <pkg-ref id="com.cbica.captk"/>
# </choice>
# <pkg-ref id="com.cbica.captk" version="$version" onConclusion="none">CaPTk_'"$version"'.pkg</pkg-ref>
# </installer-gui-script>'

# echo $xml > "./distribution.xml"

# productbuild --distribution ./distribution.xml --resources $(Build.SourcesDirectory)/bin/_CPack_Packages/OSX/DragNDrop/CaPTk_$version/ALL_IN_ONE/CaPTk_$version.app/Contents/Resources/license/ --package-path . ./CaPTk_$pkgname.pkg

# mv *_Installer* $(Build.ArtifactStagingDirectory)

# displayName: 'Package CaPTk (.dmg and .pkg)'

# - task: PublishBuildArtifacts@1
# inputs:
# pathtoPublish: '$(Build.ArtifactStagingDirectory)'
# artifactName: '$(Build.DefinitionName)_installer_macOS'

# - task: DownloadBuildArtifacts@0
# inputs:
# buildType: 'current'
# downloadType: 'single'
# artifactName: '$(Build.DefinitionName)_installer_macOS'
# downloadPath: '$(System.ArtifactsDirectory)'

# - task: CopyFilesOverSSH@0
# inputs:
# sshEndpoint: cbicaNITRC
# sourceFolder: $(Build.ArtifactStagingDirectory)
# contents: '*_Installer.*'
# targetFolder: /var/home/groups/captk/htdocs # previously /mnt/gforge-data/gforge/home/groups/captk/downloads
# cleanTargetFolder: false
# overwrite: true
# continueOnError: true
# displayName: Uploading to NITRC
# condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) )

# - job: 'Linux_SelfHost_CentOS7'
# displayName: "Self-hosted agent on CentOS 7"
Expand Down
Loading