Skip to content

Commit

Permalink
Merge branch 'UCL:master' into LMduration
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldeidda authored Nov 18, 2024
2 parents af8b6c4 + d74fcc1 commit b5ac6f1
Show file tree
Hide file tree
Showing 109 changed files with 3,445 additions and 841 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
ITK: "ON"
- os: macOS-latest
compiler: gcc
compiler_version: 11
# compiler_version: 11
cuda_version: "0"
BUILD_FLAGS: "-DSTIR_OPENMP=OFF"
parallelproj: "OFF"
Expand Down
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ Sam D Porter <[email protected]>
Sam D Porter <[email protected]> <[email protected]>
Matthew Strugari <[email protected]>
Matthew Strugari <[email protected]> <[email protected]>
Imraj Singh <[email protected]>
Imraj Singh <[email protected]> <[email protected]>
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/doublify/pre-commit-clang-format
rev: '62302476'
hooks:
- id: clang-format
files: \.(c|cc|cxx|cpp|h|hpp|hxx|inl|txx)$
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|inl|txx)$
24 changes: 14 additions & 10 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,21 @@ authors:
- family-names: Brusaferri
given-names: Ludovica
affiliation: University College London
- family-names: Pasca
given-names: Edoardo
affiliation: UK Research & Innovation
orcid: 'https://orcid.org/0000-0001-6957-2160'
- family-names: Thomas
given-names: Benjamin
orcid: 'https://orcid.org/0000-0002-9784-1177'
affiliation: University College London
- family-names: Pasca
given-names: Edoardo
affiliation: UK Research & Innovation
orcid: 'https://orcid.org/0000-0001-6957-2160'
- family-names: Aguiar
given-names: Pablo
- family-names: Niknejad
given-names: Tahereh
- family-names: Sadki
given-names: Mustapha
affiliation: Brunel University (UK)
- family-names: Schmidtlein
given-names: C Ross
- family-names: Kerrouche
given-names: Nacer
affiliation: Hammersmith Imanet Ltd
Expand All @@ -110,16 +108,22 @@ authors:
- family-names: Ehrhardt
given-names: Matthias J.
orcid: 'https://orcid.org/0000-0001-8523-353X'
- family-names: Singh
given-names: Imraj
orcid: 'https://orcid.org/0000-0003-2186-0977'
affiliation: University College London (UK)
- family-names: Schmidtlein
given-names: C Ross
- family-names: Ovtchinnikov
given-names: Evgueni
orcid: 'https://orcid.org/0000-0002-9359-6514'
affiliation: UK Research & Innovation
- family-names: Valente
given-names: Patrick
affiliation: Brunel University (UK)
- family-names: Jurjew
given-names: Nicole
affiliation: University College London
- family-names: Ovtchinnikov
given-names: Evgueni
orcid: 'https://orcid.org/0000-0002-9359-6514'
affiliation: UK Research & Innovation
- family-names: Schramm
given-names: Georg
affiliation: Katholieke Universiteit Leuven (Belgium)
Expand Down
32 changes: 32 additions & 0 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,38 @@ else()
message(STATUS "NiftyPET projector support disabled.")
endif()

if(NOT DISABLE_STIR_CUDA)
include(CheckLanguage)
check_language(CUDA)
if (CMAKE_CUDA_COMPILER)
enable_language(CUDA)
find_package(CUDAToolkit QUIET)
if (NOT CUDAToolkit_FOUND)
message(WARNING "CUDAToolkit not detected. Setting DISABLE_STIR_CUDA to ON.")
set(DISABLE_STIR_CUDA ON)
set(STIR_WITH_CUDA OFF)
else()
if("${CMAKE_VERSION}" VERSION_LESS "3.23")
message(FATAL_ERROR "CMake 3.23 or newer is required to use CMAKE_CUDA_ARCHITECTURES set to 'all'. Upgrade your CMake or set DISABLE_STIR_CUDA to ON.")
else()
set(CMAKE_CUDA_ARCHITECTURES "all")
endif()
message(STATUS "STIR CUDA support enabled. Using CUDA version ${CUDAToolkit_VERSION}.")
set(STIR_WITH_CUDA ON)
endif()
# check if run-time is available for ctests
find_program(NVIDIA_SMI nvidia-smi)
if (NOT NVIDIA_SMI)
message(WARNING "nvidia-smi not found. Disabling the ctests using CUDA")
set(SKIP_CUDA_TESTS ON)
endif()
else()
message(WARNING "No CUDA compiler found. Setting DISABLE_STIR_CUDA to ON.")
set(DISABLE_STIR_CUDA ON)
set(STIR_WITH_CUDA OFF)
endif()
endif()

# Parallelproj
if(NOT DISABLE_Parallelproj_PROJECTOR)
find_package(parallelproj 1.3.4 CONFIG)
Expand Down
4 changes: 3 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Licensing information for STIR 6.0.0
Licensing information for STIR 6.2.0
----------------------------------

See for more info http://stir.sourceforge.net, section Registration.
Expand Down Expand Up @@ -209,6 +209,7 @@ Explicit list of files that carry the PARAPET license
./src/include/stir/recon_buildblock/BackProjectorByBinUsingInterpolation.h
./src/include/stir/recon_buildblock/SymmetryOperations_PET_CartesianGrid.h
./src/include/stir/recon_buildblock/ProjMatrixElemsForOneBin.h
./src/include/stir/recon_buildblock/distributable.txx
./src/include/stir/recon_buildblock/RelatedBins.h
./src/include/stir/recon_buildblock/RelatedDensels.inl
./src/include/stir/recon_buildblock/ProjMatrixByBin.h
Expand All @@ -219,6 +220,7 @@ Explicit list of files that carry the PARAPET license
./src/include/stir/CPUTimer.h
./src/include/stir/VoxelsOnCartesianGrid.inl
./src/include/stir/stream.h
./src/include/stir/HigherPrecision.h
./src/include/stir_experimental/phantoms/Utah.h
./src/test/test_ByteOrder.cxx
./src/test/test_VectorWithOffset.cxx
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.2.0
19 changes: 13 additions & 6 deletions documentation/STIR-UsersGuide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
\\[3cm]

\textbf{{\huge User's Guide\\
Version 6.1}}
Version 6.2}}
\end{center}

\end{spacing}
Expand Down Expand Up @@ -1092,17 +1092,18 @@ \subsubsection{
the same idea while still allowing preserving some of the obliqueness.
For instance, for a dataset with 9 segments, \textbf{SSRB} can produce
a new dataset with only 3 segments. This essentially increases
the axial compression (or \textit{span} in CTI terminology), see the
the axial compression (or \textit{span} in CTI/Siemens terminology), see the
\textit{STIR} Glossary on axial compression. In addition, \textbf{SSRB} can
introduce extra \textit{mashing} (see the \textit{STIR} Glossary) of the data,
i.e. add views together.
i.e. add views and/or TOF bins together.


\textit{Usage:}

\cmdline{SSRB output\_filename input\_projdata\_name {\textbackslash} \\
num\_segments\_to\_combine [num\_views\_to\_combine {\textbackslash}\\
{[}do\_normalisation [max\_in\_segment\_num\_to\_process ]]]}
{[}do\_normalisation [max\_in\_segment\_num\_to\_process {\textbackslash}\\
{[}num\_tof\_bins\_to\_combine ]]]]}
or
\cmdline{SSRB --template template\_filename output\_filename input\_projdata\_name [do\_normalisation]}

Expand All @@ -1116,8 +1117,8 @@ \subsubsection{
the result is normalised, i.e. divided by \textit{num\_segments\_to\_combine*num\_views\_to\_combine}.
This is appropriate for rebinning data where normalisation has
already been applied, but inappropriate otherwise.

\item[template\_filename] inicated by the \textit{--template} flag,
\item[num\_tof\_bins\_to\_combine] defaults to 1, so TOF bins are not combined.
\item[template\_filename] indicated by the \textit{--template} flag,
is the sinogram type that the \textit{input\_projdata\_name} will
be mapped to. This allows for the effective use of
\textit{num\_segments\_to\_combine} to be an even number,
Expand Down Expand Up @@ -4446,6 +4447,12 @@ \subsubsection{
END Relative Difference Prior Parameters:=
\end{verbatim}

Note that if you have the \em{CUDA} drivers (and toolkit when building), setting
\begin{verbatim}
prior type := Cuda Relative Difference Prior
\end{verbatim}
will enable a \em{CUDA} implementation (with some restrictions). Other parameter
settings are identical.

{ \subsubsubsection{Logcosh} \label{sec:priors:Logcosh}
}
Expand Down
14 changes: 10 additions & 4 deletions documentation/STIR-developers-overview.tex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
\textbf{{\huge STIR \\
Overview for developers}}\\
\textbf{Kris Thielemans}\\
\textbf{\textit{version 6.0}}
\textbf{\textit{version 6.2}}

\end{center}

Expand Down Expand Up @@ -60,8 +60,8 @@ \section{
doxygen on the source files that come in the STIR distribution).

\subsection{Language support}
STIR is written in C++ and currently requires C++-14, but it is compatible with newer versions of the C++ standard.
We will enforce C++-16 from STIR 6.2.
STIR is written in C++ and currently requires C++-17, but it is compatible with newer versions of the C++ standard.
We will enforce C++-20 from STIR 7.0 (possibly earlier).

Python and MATLAB support is provided via \R2Lurl{http://www.swig.org/}{SWIG}. This means that Python/MATLAB interfaces follow
the C++ classes closely, although some differences are required as these languages do not support templates for instance.
Expand Down Expand Up @@ -392,7 +392,7 @@ \subsection{
with info on the file and line number where the assertion failed.

\subsection{C++ conventions}
STIR uses C++-14 and is compatible with C++-20 to the best of our knowledge.
STIR uses C++-17 and is compatible with C++-20 to the best of our knowledge.
For legacy reasons, we have some preprocessor
macros (see \textit{stir/common.h}) to define the stir namespace (see below).
These should disappear at a
Expand Down Expand Up @@ -622,6 +622,12 @@ \subsubsection{typedefs}
};
\end{verbatim}

\section{CUDA support}
STIR 6.2 introduced first versions of some CUDA code. The include file
\texttt{cuda\_utilities.h} contains some helpers classes to copy
arrays to/from the device. This is still work-in-progress as objects
cannot remain on the device.

\section{
Overview of classes}

Expand Down
4 changes: 2 additions & 2 deletions documentation/STIR-glossary.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
\end{center}

\begin{center}
\textit{Version 6.0}\\
\textit{Version 6.2}\\
Originally based on PARAPET Deliverable 4.1,
Extended for Quantitative Reconstruction and motion compensation

Expand Down Expand Up @@ -207,7 +207,7 @@ \section*{Different (lossy) data compressions used}
by the scanner (in list-mode) over the actual number of TOF bins. Currently in STIR, this
ratio has to be an integer. The size of a TOF bin is computed by multiplying the
\textbf{TOF mashing factor} with the \textbf{size of unmashed TOF time bins}, with the latter
defined as a scanner property.\\
defined as a scanner property. \texttt{SSRB} can be used to increase the TOF mashing factor.\\
Note that many PET scanners use a \textbf{TOF mashing factor} greater than 1
for their standard histogrammed projection data.

Expand Down
3 changes: 2 additions & 1 deletion documentation/credits.htm
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ <h2>contributions since the PARAPET EU project (April 2000)</h2>
Emond, Elise
Falc&oacute;n, Carl&eacute;s
Twyman, Robert
Singh, Imraj
Jurjew, Nicole
Bertolli, Ottavia
Tsai, Yu-jung
Expand Down Expand Up @@ -244,7 +245,7 @@ <h2>Web site</h2>
<hr>
<!-- Created: Fri Jan 04 2002 -->
<!-- hhmts start -->
Last modified: Wed Feb 07 2024
Last modified: Tue Jul 23 2024
<!-- hhmts end -->
</body>
</html>
8 changes: 6 additions & 2 deletions documentation/devel/editor-settings.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Developer documentation: editor settings

White-spaces and indentation with multiple developers are a pain. Please adhere to
our white-space policy, which we try to enforce via [clang-format](https://clang.llvm.org/docs/ClangFormat.html).
Check that site for integration with your editor/IDE.
our white-space policy, which we enforce via [pre-commit](https://pre-commit.com/), including
running of [clang-format](https://clang.llvm.org/docs/ClangFormat.html).
See [git-hooks.md](git-hooks.md) for more information.

Developer experience will be best if you set your editor/IDE to use the same settings,
including versions of the formatters (`clang-format` in particular).
22 changes: 19 additions & 3 deletions documentation/devel/git-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@
We use [pre-commit](https://pre-commit.com) to check coding conventions, including
white-space formatting rules.

Unfortunately, exact formatting used depends on the `clang-format` version. Therefore,
you do have to install the same version as what is currently used in our GitHub Action.
Unfortunately, exact formatting used depends on the `clang-format` (and others?) version. Therefore,
you might need to install the same version as what is currently used in our
[.pre-commit-config.yaml](../../.pre-commit-config.yaml) for your editor to pick up
the same version.

## Installation of software

### TL;DR

```sh
pip/conda install pre-commit
git add blabla
pre-commit run
# optionally check files
# "add" changes made by the hooks
git add blabla
git commit
```

### More detail

We highly recommend to use `conda`:
```sh
cd /whereever/STIR
Expand Down Expand Up @@ -48,4 +64,4 @@ or one-off with

git commit --no-verify

You will then need to run `pre-commit run --all-files` when done before we will merge your pull request.
You will then need to run `pre-commit run --all-files` when done before we will merge your pull request.
1 change: 1 addition & 0 deletions documentation/history.htm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h1>History of public releases of the STIR software</h1>
The following links give you a summary what has changed. However,
the ChangeLog is the definite (but tedious) information.
<ul >
<li><a href="release_6.2.htm">version 6.2.0 (dated 23 July 2024)</a></li>
<li><a href="release_6.1.htm">version 6.1.0 (dated 16 May 2024)</a></li>
<li><a href="release_6.0.htm">version 6.0.0 (dated 07 February 2024)</a></li>
<li><a href="release_5.2.htm">version 5.2.0 (dated 30 October 2023)</a></li>
Expand Down
Loading

0 comments on commit b5ac6f1

Please sign in to comment.