Skip to content

Commit

Permalink
Merge pull request #1359 from KrisThielemans/add_stir_list_registries
Browse files Browse the repository at this point in the history
Add stir_list_registries utility
  • Loading branch information
KrisThielemans authored Feb 1, 2024
2 parents e5aa1e1 + 135f0c1 commit 37762e2
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 1 deletion.
3 changes: 3 additions & 0 deletions documentation/STIR-UsersGuide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2872,6 +2872,9 @@ \subsubsection{Displaying STIR configuration and version information}
(Equivalent functions in C++/Python are \texttt{get\_STIR\_config\_dir},
\texttt{get\_STIR\_doc\_dir} and \texttt{get\_STIR\_examples\_dir}).

\textbf{stir\_list\_registries} is a utility that list possible values of various
registries, which can be useful to know what to use in a <tt>.par<tt> file.

\subsubsection{
Displaying and performing operations on data}

Expand Down
6 changes: 5 additions & 1 deletion documentation/release_6.0.htm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ <h4>General</h4>
<tt>list_lm_events</tt> now has an additional option <tt>--event-bin</tt> which lists the bin
assigned for the event (according to the "native" projection data, i.e. without any mashing).<br>
In addition, the <tt>--event-LOR<tt> option now also works for SPECT (it was disabled by accident).
</li>
</li>
<li>
<tt>stir_list_registries</tt> is a new utility that list possible values of various
registries, which can be useful to know what to use in a <tt>.par</tt> file.
</li>
</ul>

<h4>Python (and MATLAB)</h4>
Expand Down
3 changes: 3 additions & 0 deletions src/recon_buildblock/recon_buildblock_registries.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ static OSMAPOSLReconstruction<DiscretisedDensity<3,float> >::RegisterIt dummy603
static KOSMAPOSLReconstruction<DiscretisedDensity<3,float> >::RegisterIt dummyK ;
static OSSPSReconstruction<DiscretisedDensity<3, float> >::RegisterIt dummy604;

static OSMAPOSLReconstruction<ParametricVoxelsOnCartesianGrid >::RegisterIt dummyOSMAPOSLPVC;
static OSSPSReconstruction<ParametricVoxelsOnCartesianGrid >::RegisterIt dummyOSSPSPVC;

#ifdef STIR_WITH_NiftyPET_PROJECTOR
static ForwardProjectorByBinNiftyPET::RegisterIt gpu_fwd;
static BackProjectorByBinNiftyPET::RegisterIt gpu_bck;
Expand Down
1 change: 1 addition & 0 deletions src/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ set(${dir_EXE_SOURCES}
conv_interfile_to_gipl.cxx
shift_image.cxx
stir_config.cxx
stir_list_registries.cxx
shift_image_origin.cxx
warp_and_accumulate_gated_images.cxx
warp_image.cxx
Expand Down
71 changes: 71 additions & 0 deletions src/utilities/stir_list_registries.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*!
Copyright (C) 2024 University College London
This file is part of STIR.
SPDX-License-Identifier: Apache-2.0
See STIR/LICENSE.txt for details
\file
\ingroup utilities
\brief Prints all registered names for many registries
\author Kris Thielemans
*/

#include "stir/DiscretisedDensity.h"
#include "stir/modelling/ParametricDiscretisedDensity.h"
#include "stir/DynamicDiscretisedDensity.h"
#include "stir/DataProcessor.h"
#include "stir/recon_buildblock/ForwardProjectorByBin.h"
#include "stir/recon_buildblock/BackProjectorByBin.h"
#include "stir/recon_buildblock/ProjectorByBinPair.h"
#include "stir/recon_buildblock/ProjMatrixByBin.h"
#include "stir/recon_buildblock/GeneralisedObjectiveFunction.h"
#include "stir/recon_buildblock/GeneralisedPrior.h"
#include "stir/recon_buildblock/Reconstruction.h"
#include "stir/recon_buildblock/BinNormalisation.h"
#include <iostream>
#include <cstdlib>

USING_NAMESPACE_STIR

int
main(int argc, char *argv[])
{
std::cout << "------------ ProjectorByBinPair --------------\n";
ProjectorByBinPair::list_registered_names(std::cout);
std::cout << "------------ ForwardProjectorByBin --------------\n";
ForwardProjectorByBin::list_registered_names(std::cout);
std::cout << "------------ BackProjectorByBin --------------\n";
BackProjectorByBin::list_registered_names(std::cout);
std::cout << "------------ ProjMatrixByBin --------------\n";
ProjMatrixByBin::list_registered_names(std::cout);
std::cout << "------------ BinNormalisation --------------\n";
BinNormalisation::list_registered_names(std::cout);

std::cout << "--------------------------------------------------------------------------\n";

std::cout << "------------ DataProcessor<DiscretisedDensity<3,float>> --------------\n";
DataProcessor<DiscretisedDensity<3,float> >::list_registered_names(std::cout);
std::cout << "------------ GeneralisedObjectiveFunction<DiscretisedDensity<3,float>> --------------\n";
GeneralisedObjectiveFunction<DiscretisedDensity<3,float>>::list_registered_names(std::cout);
std::cout << "------------ GeneralisedPrior<DiscretisedDensity<3,float>> --------------\n";
GeneralisedPrior<DiscretisedDensity<3,float>>::list_registered_names(std::cout);
std::cout << "------------ Reconstruction<DiscretisedDensity<3,float>> --------------\n";
Reconstruction<DiscretisedDensity<3,float>>::list_registered_names(std::cout);

std::cout << "--------------------------------------------------------------------------\n";

std::cout << "------------ DataProcessor<ParametricVoxelsOnCartesianGrid> --------------\n";
DataProcessor<ParametricVoxelsOnCartesianGrid >::list_registered_names(std::cout);
std::cout << "------------ GeneralisedObjectiveFunction<ParametricVoxelsOnCartesianGrid> --------------\n";
GeneralisedObjectiveFunction<ParametricVoxelsOnCartesianGrid>::list_registered_names(std::cout);
std::cout << "------------ GeneralisedPrior<ParametricVoxelsOnCartesianGrid> --------------\n";
GeneralisedPrior<ParametricVoxelsOnCartesianGrid>::list_registered_names(std::cout);
std::cout << "------------ Reconstruction<ParametricVoxelsOnCartesianGrid> --------------\n";
Reconstruction<ParametricVoxelsOnCartesianGrid>::list_registered_names(std::cout);


return EXIT_SUCCESS;
}

0 comments on commit 37762e2

Please sign in to comment.