This repository contains a Chaste User Project used to generate the anatomical surrogate of newborn airways.
Edit your ~/.bashrc by adding the following lines at the end of the
file:
# ...at the end of ~/.bashrc
export CHASTE_TEST_OUTPUT=$HOME/Chaste-Tests-Output
export CHASTE_BUILD_DIR=$HOME/Builds/Chaste
export CHASTE_REPO_DIR=$HOME/Repos/ChasteReplace Chaste-Tests-Output with the preferred location for Tests'
output.
It's possible to do that by using this command
# Run this to append the former line.
echo "export CHASTE_TEST_OUTPUT=$HOME/Chaste-Tests-Output" >> ~/.bashrc
echo "export CHASTE_BUILD_DIR=$HOME/Builds/Chaste" >> ~/.bashrc
echo "export CHASTE_REPO_DIR=$HOME/Repos/Chaste" >> ~/.bashrcSource the file just modified and create the required folders:
source ~/.bashrc
mkdir -p $CHASTE_TEST_OUTPUT ~/Repos $CHASTE_BUILD_DIRClone Chaste repository.
cd ~/Repos
git clone https://github.com/Chaste/ChastePlease refer to Chaste guide to complete this passage.
Navigate to $CHASTE_REPO_DIR/projects and clone this project in that
location.
cd $CHASTE_REPO_DIR/projects
git clone https://github.com/andriluca/NewbornAirwayGenerationNow Chaste repository is set. You can proceed and install Chaste and this project from source!
Run cmake from Chaste build folder.
cd $CHASTE_BUILD_DIR
cmake $CHASTE_REPO_DIRCompile with make.
# Number of available threads on your machine.
N=4
# Navigate to Chaste build directory and compile both `lung` and `TestNewbornAirwayGeneration` target.
cd $CHASTE_BUILD_DIR
make -j$N lung
make -j$N TestNewbornAirwayGeneration
# Run this test.
ctest -V -R TestNewbornAirwayGenerationCheckout if the test is 100% passed. If so congratulations, you have successfully installed this User Project.
It's required to provide two pieces of input:
- Major airways
- Lobe segmentations
It is possible to start from two source files:
airway.node: List of nodes. Each node represent a point in the major airways centreline with 3 coordinates (x, y, z) and two attributes:radiusandstart_id.radius(self explainatory) is evaluated in that point.start_idis a flag being 1 for generative points (i.e. points from which branching is allowed), 0 otherwise.airway.edge: List of edges. Each edge is connecting two endpoints.
You can learn more about such files by referring to Chaste tests
TestMultiLobeAirwayGenerator.hpp and
TestAirwayGenerationTutorial.hpp.
It's also possible to start from one single vtu files:
major_airways.vtu: vtk unstructured grid file
They represent physical limits to airway "growth" process and should be five:
LLL.stl: Left, Lower LungLUL.stl: Left, Upper LungRLL.stl: Right Lower LungRML.stl: Right Mid LungRUL.stl: Right Upper Lung
Generated output is located in
$CHASTE_TEST_OUTPUT/TestNewbornAirwayGeneration/. Navigate to that
folder and open the files complete_conducting_airway.node and
complete_conducting_airway.edge. Other output files are available
in the same folder. Use them at your will.