Skip to content

Commit

Permalink
Merge branch 'master' into regressionv2
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazishkhan1-nk authored Aug 13, 2024
2 parents b1ad5a1 + c73a9e2 commit 0c3214b
Show file tree
Hide file tree
Showing 44 changed files with 718 additions and 621 deletions.
17 changes: 1 addition & 16 deletions .github/workflows/build-linux-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ jobs:

steps:

- name: Install SSH Key
uses: shimataro/[email protected]
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Conda info
run: conda info

Expand All @@ -60,10 +54,6 @@ jobs:
- name: Get tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*

- name: Restore Caches
shell: bash -l {0}
run: .github/workflows/restore_caches.sh

- name: Check space3
run: df -h

Expand All @@ -83,7 +73,7 @@ jobs:

- name: cmake
shell: bash -l {0}
run: conda activate shapeworks && mkdir build && cd build && cmake -DCMAKE_CXX_FLAGS=-g -DITK_DIR=$HOME/install/lib/cmake/ITK-5.2 -DVTK_DIR=$HOME/install/lib/cmake/vtk-9.1 -DXLNT_DIR=$HOME/install -DLIBIGL_DIR=$HOME/install -DOpenVDB_DIR=$HOME/install/lib/cmake/OpenVDB -DGEOMETRYCENTRAL_DIR=$HOME/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBuild_Studio=ON -DJKQTCommonSharedLib_DIR=$HOME/install/lib/cmake/JKQTCommonSharedLib -DJKQTMathTextSharedLib_DIR=$HOME/install/lib/cmake/JKQTMathTextSharedLib -DJKQTPlotterSharedLib_DIR=$HOME/install/lib/cmake/JKQTPlotterSharedLib -DACVD_DIR=$HOME/install -DCMAKE_PREFIX_PATH=${CONDA_PREFIX} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/shapeworks-install -DUSE_ORIGIN_RPATH=ON ..
run: conda activate shapeworks && mkdir build && cd build && cmake -DCMAKE_CXX_FLAGS=-g -DITK_DIR=$HOME/install/lib/cmake/ITK-5.3 -DVTK_DIR=$HOME/install/lib/cmake/vtk-9.1 -DXLNT_DIR=$HOME/install -DLIBIGL_DIR=$HOME/install -DOpenVDB_DIR=$HOME/install/lib/cmake/OpenVDB -DGEOMETRYCENTRAL_DIR=$HOME/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBuild_Studio=ON -DJKQTCommonSharedLib_DIR=$HOME/install/lib/cmake/JKQTCommonSharedLib -DJKQTMathTextSharedLib_DIR=$HOME/install/lib/cmake/JKQTMathTextSharedLib -DJKQTPlotterSharedLib_DIR=$HOME/install/lib/cmake/JKQTPlotterSharedLib -DACVD_DIR=$HOME/install -DCMAKE_PREFIX_PATH=${CONDA_PREFIX} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/shapeworks-install -DUSE_ORIGIN_RPATH=ON ..

- name: Check space6
run: df -h
Expand All @@ -106,9 +96,4 @@ jobs:
- name: make test
shell: bash -l {0}
run: conda activate shapeworks && source ./devenv.sh ./build/bin && cd build && ctest -VV

- name: Store ccache
shell: bash -l {0}
run: .github/workflows/store_ccache.sh


21 changes: 1 addition & 20 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ jobs:

steps:

- name: Install SSH Key
uses: shimataro/[email protected]
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Conda info
run: conda info

Expand All @@ -61,10 +55,6 @@ jobs:
- name: Check space3
run: df -h

- name: Restore Caches
shell: bash -l {0}
run: .github/workflows/restore_caches.sh

- name: Conda Installs
shell: bash -l {0}
run: .github/workflows/gha_conda.sh
Expand All @@ -82,7 +72,7 @@ jobs:

- name: cmake
shell: bash -l {0}
run: conda activate shapeworks && mkdir build && cd build && cmake -DCMAKE_CXX_FLAGS=-g -DITK_DIR=$HOME/install/lib/cmake/ITK-5.2 -DVTK_DIR=$HOME/install/lib/cmake/vtk-9.1 -DXLNT_DIR=$HOME/install -DLIBIGL_DIR=$HOME/install -DOpenVDB_DIR=$HOME/install/lib/cmake/OpenVDB -DGEOMETRYCENTRAL_DIR=$HOME/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBuild_Studio=ON -DJKQTCommonSharedLib_DIR=$HOME/install/lib/cmake/JKQTCommonSharedLib -DJKQTMathTextSharedLib_DIR=$HOME/install/lib/cmake/JKQTMathTextSharedLib -DJKQTPlotterSharedLib_DIR=$HOME/install/lib/cmake/JKQTPlotterSharedLib -DACVD_DIR=$HOME/install -DCMAKE_PREFIX_PATH=${CONDA_PREFIX} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/shapeworks-install -DUSE_ORIGIN_RPATH=ON -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET ..
run: conda activate shapeworks && mkdir build && cd build && cmake -DCMAKE_CXX_FLAGS=-g -DITK_DIR=$HOME/install/lib/cmake/ITK-5.3 -DVTK_DIR=$HOME/install/lib/cmake/vtk-9.1 -DXLNT_DIR=$HOME/install -DLIBIGL_DIR=$HOME/install -DOpenVDB_DIR=$HOME/install/lib/cmake/OpenVDB -DGEOMETRYCENTRAL_DIR=$HOME/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBuild_Studio=ON -DJKQTCommonSharedLib_DIR=$HOME/install/lib/cmake/JKQTCommonSharedLib -DJKQTMathTextSharedLib_DIR=$HOME/install/lib/cmake/JKQTMathTextSharedLib -DJKQTPlotterSharedLib_DIR=$HOME/install/lib/cmake/JKQTPlotterSharedLib -DACVD_DIR=$HOME/install -DCMAKE_PREFIX_PATH=${CONDA_PREFIX} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/shapeworks-install -DUSE_ORIGIN_RPATH=ON -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET ..

- name: Check space5
run: df -h
Expand Down Expand Up @@ -115,10 +105,6 @@ jobs:
shell: bash -l {0}
run: conda activate shapeworks && source ./devenv.sh ./build/bin && cd build && ctest -VV

- name: Copy artifact
shell: bash -l {0}
run: cd /__w/ShapeWorks/ShapeWorks/artifacts && ${GITHUB_WORKSPACE}/.github/workflows/copy_artifact.sh artifact-${{github.sha}}-linux *

- uses: actions/upload-artifact@v2
with:
name: artifact-${{github.sha}}-linux
Expand All @@ -135,9 +121,4 @@ jobs:
title: "Development Build for Linux"
files: |
${{runner.workspace}}/ShapeWorks/artifacts/*.tar.gz
- name: Store ccache
shell: bash -l {0}
run: .github/workflows/store_ccache.sh

18 changes: 0 additions & 18 deletions .github/workflows/build-mac-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ jobs:

steps:

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Setup Miniconda
uses: conda-incubator/[email protected]

Expand All @@ -52,10 +46,6 @@ jobs:
- name: Get tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*

- name: Restore Caches
shell: bash -l {0}
run: .github/workflows/restore_caches.sh

- name: Conda Installs
shell: bash -l {0}
run: .github/workflows/gha_conda.sh
Expand Down Expand Up @@ -115,12 +105,4 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Store ccache
shell: bash -l {0}
run: .github/workflows/store_ccache.sh

- name: Copy artifact
shell: bash -l {0}
run: cd ${{runner.workspace}}/ShapeWorks && ${GITHUB_WORKSPACE}/.github/workflows/copy_artifact.sh artifact-${{github.sha}}-mac-arm64 artifacts

19 changes: 0 additions & 19 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ jobs:

steps:

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: OS Setup
run: |
ls /usr/local
Expand All @@ -57,10 +51,6 @@ jobs:
- name: Get tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*

- name: Restore Caches
shell: bash -l {0}
run: .github/workflows/restore_caches.sh

- name: Conda Installs
shell: bash -l {0}
run: .github/workflows/gha_conda.sh
Expand Down Expand Up @@ -120,12 +110,3 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Store ccache
shell: bash -l {0}
run: .github/workflows/store_ccache.sh

- name: Copy artifact
shell: bash -l {0}
run: cd ${{runner.workspace}}/ShapeWorks && ${GITHUB_WORKSPACE}/.github/workflows/copy_artifact.sh artifact-${{github.sha}}-mac artifacts

23 changes: 6 additions & 17 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Init conda
shell: bash -l {0}
run: /c/Miniconda/condabin/conda.bat init --all

# - name: link
# shell: bash -l {0}
# run: cd /usr/bin && ln -s /c/Miniconda/condabin/conda.bat conda
Expand All @@ -65,12 +65,6 @@ jobs:
# with:
# miniconda-version: 'latest'

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Checkout code
uses: actions/checkout@v3
with:
Expand All @@ -79,16 +73,16 @@ jobs:
- name: Get tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*

- name: Download test data
shell: bash -l {0}
run: .github/workflows/download_test_data.sh

- name: Get NSIS
working-directory: ${{runner.workspace}}
run: |
curl -o nsis.zip http://www.sci.utah.edu/~amorris/NSISPortable_3.04.zip
Expand-Archive -LiteralPath nsis.zip -DestinationPath .
- name: Restore Caches
shell: bash -l {0}
run: .github/workflows/restore_caches.sh

- name: Conda Installs
shell: bash -l {0}
run: .github/workflows/gha_conda.sh
Expand All @@ -115,7 +109,7 @@ jobs:
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: conda activate shapeworks && cmake $GITHUB_WORKSPACE -DCMAKE_CXX_FLAGS="-FS" -DCMAKE_C_FLAGS="-FS" -DCMAKE_CXX_FLAGS_RELEASE="-FS /Zm500 /Zi /GL /MD /O2 /Ob3 /DNDEBUG /EHsc" -DCMAKE_C_FLAGS_RELEASE="-FS /Zi /GL /MD /O2 /Ob3 /DNDEBUG /EHsc" -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-LTCG /DEBUG" -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-LTCG /DEBUG" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DITK_DIR="C:\deps\lib\cmake\ITK-5.2" -DVTK_DIR="C:\deps\lib\cmake\vtk-9.1" -DXLNT_DIR="C:\deps" -DLIBIGL_DIR="C:\deps" -DJKQTCommonSharedLib_DIR="C:/deps/lib/cmake/JKQTCommonSharedLib" -DJKQTMathTextSharedLib_DIR="C:/deps/lib/cmake/JKQTMathTextSharedLib" -DJKQTPlotterSharedLib_DIR="C:/deps/lib/cmake/JKQTPlotterSharedLib" -DOpenVDB_DIR="C:\deps\lib\cmake\OpenVDB" -DGEOMETRYCENTRAL_DIR="C:\deps" -DACVD_DIR="C:\deps" -DBuild_Studio=ON -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET
run: conda activate shapeworks && cmake $GITHUB_WORKSPACE -DCMAKE_CXX_FLAGS="-FS" -DCMAKE_C_FLAGS="-FS" -DCMAKE_CXX_FLAGS_RELEASE="-FS /Zm500 /Zi /GL /MD /O2 /Ob3 /DNDEBUG /EHsc" -DCMAKE_C_FLAGS_RELEASE="-FS /Zi /GL /MD /O2 /Ob3 /DNDEBUG /EHsc" -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-LTCG /DEBUG" -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-LTCG /DEBUG" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DITK_DIR="C:\deps\lib\cmake\ITK-5.3" -DVTK_DIR="C:\deps\lib\cmake\vtk-9.1" -DXLNT_DIR="C:\deps" -DLIBIGL_DIR="C:\deps" -DJKQTCommonSharedLib_DIR="C:/deps/lib/cmake/JKQTCommonSharedLib" -DJKQTMathTextSharedLib_DIR="C:/deps/lib/cmake/JKQTMathTextSharedLib" -DJKQTPlotterSharedLib_DIR="C:/deps/lib/cmake/JKQTPlotterSharedLib" -DOpenVDB_DIR="C:\deps\lib\cmake\OpenVDB" -DGEOMETRYCENTRAL_DIR="C:\deps" -DACVD_DIR="C:\deps" -DBuild_Studio=ON -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET

- name: Build
working-directory: "C:/build"
Expand Down Expand Up @@ -174,8 +168,3 @@ jobs:
title: "Development Build for Windows"
files: |
d:/a/ShapeWorks/ShapeWorks/artifacts/*.exe
- name: Copy artifact
shell: bash -l {0}
run: cd /d/a/ShapeWorks/ShapeWorks/artifacts && ${GITHUB_WORKSPACE}/.github/workflows/copy_artifact.sh artifact-${{github.sha}}-windows *

7 changes: 6 additions & 1 deletion .github/workflows/download_test_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ BASE=`pwd`
# based on root folder
cd /

# if platform is windows, install wget
if [ "$PLATFORM" == "windows" ]; then
choco install wget --no-progress
fi

# Tiny test data downloads
for run in {1..5}; do
if [ ! -f /tmp/tiny_test_cache.tar.gz ] ; then
scp runner@${CACHE_HOST}:github/tiny_test_cache.tar.gz /tmp || true
cd /tmp
wget https://www.sci.utah.edu/~shapeworks/doc-resources/zips/tiny_test_cache.tar.gz || true
sleep 1
fi
done
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/gha_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ else
# run install
source ./install_shapeworks.sh --developer
conda clean -p -t -y

echo "Create and store cache"
cd /
compress_file /tmp/${CONDA_FILE} "${CONDA_PATH}"
scp /tmp/${CONDA_FILE} runner@${CACHE_HOST}:github
rm /tmp/${CONDA_FILE}
fi

conda init bash
6 changes: 0 additions & 6 deletions .github/workflows/gha_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,4 @@ else

./build_dependencies.sh --build-type=$BUILD_TYPE --num-procs=$NPROCS --clean-after
rm -rf $BUILD_DIR

echo "Create and store cache"
cd /
compress_file ${FILE} "${DEP_PATH}"
scp ${FILE} runner@${CACHE_HOST}:github
rm ${FILE}
fi
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ endif()
find_package (Eigen3 3.3 REQUIRED NO_MODULE)

### ITK
FIND_PACKAGE(ITK 5.2.1 REQUIRED)
FIND_PACKAGE(ITK 5.3.0 REQUIRED)
IF (ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE()
Expand Down
3 changes: 3 additions & 0 deletions Examples/Python/Data/femur_pvalues.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions Examples/Python/Data/supershapes_1mode_contour.zip
Git LFS file not shown
2 changes: 1 addition & 1 deletion Examples/Python/ellipsoid_fd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def Run_Pipeline(args):
We define dataset_name which determines which dataset to download from
the portal and the directory to save output from the use case in.
"""
dataset_name = "ellipsoid_fd"
dataset_name = "ellipsoid_fd_multiscale"
output_directory = "Output/ellipsoid_fd/"
if not os.path.exists(output_directory):
os.makedirs(output_directory)
Expand Down
8 changes: 6 additions & 2 deletions Examples/Python/femur_pvalues.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import numpy as np
import pandas as pd
import json
import zipfile

def Run_Pipeline(args):
output_directory = 'Output/femur_pvalues/'
if not os.path.exists(output_directory):
os.makedirs(output_directory)

dataset_name = 'femur_pvalues'
sw.download_dataset(dataset_name, output_directory)
# unzip Data/femur_pvalues.zip
zip_file = 'Data/femur_pvalues.zip'
with zipfile.ZipFile(zip_file, 'r') as zip_ref:
zip_ref.extractall("Output/")

swproj_file = f'{output_directory}/femur_pvalues.swproj'
csvfile = convert_swproj_to_csv(swproj_file)
data = pd.read_csv(csvfile)
Expand Down
8 changes: 7 additions & 1 deletion Examples/Python/supershapes_1mode_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import shapeworks as sw
import subprocess
import numpy as np
import zipfile

from ShapeCohortGen.CohortGenerator import Supershapes2DCohortGenerator

def Run_Pipeline(args):
Expand All @@ -21,8 +23,12 @@ def Run_Pipeline(args):
output_directory = "Output/supershapes_1mode_contour/"
if not os.path.exists(output_directory):
os.makedirs(output_directory)

# See the generate_supershapes() function in this file for how the data is generated
sw.download_dataset(dataset_name, output_directory)
zip_file = 'Data/supershapes_1mode_contour.zip'
with zipfile.ZipFile(zip_file, 'r') as zip_ref:
zip_ref.extractall("Output/")
# sw.download_dataset(dataset_name, output_directory)
dataset_name = "supershapes2D_1mode"
contour_files = sorted(glob.glob(output_directory + dataset_name + "/contours/*.vtp"))

Expand Down
6 changes: 3 additions & 3 deletions Libs/Analyze/Shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ void Shape::load_feature(DisplayMode display_mode, std::string feature) {
ImageType::Pointer image = reader->GetOutput();
group.meshes()[d]->apply_feature_map(feature, image);
apply_feature_to_points(feature, image);
} catch (itk::ExceptionObject& excep) {
SW_ERROR("Unable to open file: " + filename);
} catch (std::exception& ex) {
SW_ERROR("Unable to open file \"{}\": {}", filename, ex.what());
}
}
}
Expand All @@ -582,7 +582,7 @@ std::shared_ptr<Image> Shape::get_image_volume(std::string image_volume_name) {
image_volume_ = image;
image_volume_filename_ = filename;
} catch (std::exception& ex) {
SW_ERROR("Unable to open file: {}", filename);
SW_ERROR("Unable to open file \"{}\": {}", filename, ex.what());
}
}

Expand Down
2 changes: 0 additions & 2 deletions Libs/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ set(Common_sources
Shapeworks.cpp
ShapeworksUtils.cpp
Region.cpp
Exception.cpp
Logging.cpp
)
set(Common_headers
Shapeworks.h
ShapeworksUtils.h
Region.h
Exception.h
Logging.h
)
add_library(Common STATIC
Expand Down
13 changes: 0 additions & 13 deletions Libs/Common/Exception.cpp

This file was deleted.

Loading

0 comments on commit 0c3214b

Please sign in to comment.