Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions documentation/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ If no error appears, then PCT was successfully installed.

If you need to edit the source code of PCT, or tune the compilation process, then you need to manually compile PCT. PCT depends on [ITK](https://itk.org) and [RTK](https://openrtk.org), the first step is therefore to download and compile them.

### Create a python virtual environment

If you want to use PCT as a python module, it's preferable to create a new virtual environement. Numpy is also mandatory to compile ITK python wrapping:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace "compile" with "use" I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used "compile" because numpy is necessary during cmake configuration of ITK in order to have the wrappings

```bash
python -m venv venv_pct
source venv_pct/bin/activate
pip install numpy
```

### Compiling ITK and RTK

RTK comes bundled as an ITK module, so it is enough to download ITK and compile it with an option that indicates that RTK is also required. First, clone ITK from GitHub:
Expand All @@ -30,22 +39,27 @@ git clone git@github.com:InsightSoftwareConsortium/ITK.git

Then, create a compilation folder for ITK:
```
mkdir itk-build
mkdir itk-build itk-install
cd itk-build
```

ITK uses [CMake](https://cmake.org) as its building tool. Below is an example of how to configure ITK, but feel free to edit the options as needed.
ITK uses [CMake](https://cmake.org) as its building tool. Below is an example of how to configure ITK, but feel free to edit the options as needed (works with ITK v6.0a1).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this added reference to ITK v6.0a1 which will soon be outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not succeed to compile RTK with ITK v6.0a2

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to support ITK alpha versions and even less indicate versions numbers in the documentation. So it's either main branches for all modules or latest release (ITK v5.4.5). @axel-grc can you please clarify the status of the RTK main and v2.7.0 compilation against ITK main, ITK v5.4.5 and ITK v6.0b02? Thanks, for the record the list of ITK tags:
https://github.com/InsightSoftwareConsortium/ITK/tags

```bash
cmake \
-DITK_WRAP_PYTHON=ON \
-DModule_RTK=ON \
-DModule_RTK_GIT_TAG=main \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think main is necessary, I would remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not succeed to compile ITK v6.0a1 with the tagged version of RTK and CudaCommon

-DModule_CudaCommon=ON \
-DModule_CudaCommon_GIT_TAG=ON \
Comment on lines +52 to +53
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the Cuda options in this documentation.

-DCMAKE_INSTALL_PREFIX=<path-to>/itk-install \
../ITK
```
`ITK_WRAP_PYTHON` mean that ITK will generate and compile Python wrapping for the C++ code, which is also supported by PCT. This option massively increases compilation time, so if Python wrappings are not needed, this option can be disabled. `Module_RTK` enables the compilation of RTK, which is required for PCT.
`ITK_WRAP_PYTHON` mean that ITK will generate and compile Python wrapping for the C++ code, which is also supported by PCT. This option massively increases compilation time, so if Python wrappings are not needed, this option can be disabled. `Module_RTK` enables the compilation of RTK, which is required for PCT. And CudaCommon is necesary if you want to use your GPU.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove, there is no GPU code in PCT


Once configuration finishes, the compilation is started using
Once configuration finishes, the compilation is started using. The installation allows you to have access in your python virtual environment if it was activated before.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence was added in the middle of an unfinished one and I don't really understand what it means...

```
cmake --build .
make install
```
Depending on your machine and whether `ITK_WRAP_PYTHON` is on, compiling ITK can take from few minutes up to several hours.

Expand All @@ -58,20 +72,22 @@ git clone https://github.com/RTKConsortium/PCT.git

Then, create a build directory for PCT:
```bash
mkdir pct-build
mkdir pct-build pct-install
cd pct-build
```

Similar to ITK, configuration and compilation is handled via [CMake](https://cmake.org/). Configuration can be achieved using
```bash
cmake \
-DITK_DIR=<path to ITK build folder> \
-DCMAKE_INSTALL_PREFIX=<path-to>/pct-install
Copy link
Collaborator

@SimonRit SimonRit Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually work? I think you cannot install Python compilation of a remote module if it is compiled independently of ITK. See
https://github.com/RTKConsortium/RTK/blob/main/CMakeLists.txt#L349

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works for me with PCT

-DPCT_BUILD_APPLICATIONS=ON \
../PCT
```
Once configuration completes, the compilation can be achieved using
```bash
cmake --build .
make install
```

Optionally, PCT can be added to the user's `$PATH` variable using for instance
Expand Down
Loading