Source Documentation

class BadConfigurationError : public pFIREExpectedError
#include <exceptions.hpp>

Public Functions

BadConfigurationError(const std::string &msg, std::string file = "unknown", size_t line = 0)
class BaseLoader
#include <baseloader.hpp>

Subclassed by DCMLoader, OIIOLoader, ShIRTLoader

Public Types

using loader_creator = std::function<BaseLoader_unique(const std::string &filename, MPI_Comm comm)>
using loader_map = std::map<std::string, loader_creator>

Public Functions

BaseLoader(const std::string &path, MPI_Comm comm = PETSC_COMM_WORLD)
virtual ~BaseLoader()
const intvector &shape() const
virtual void copy_scaled_chunk(floating ***data, const intvector &size, const intvector &offset) const = 0

Public Static Functions

static const loader_map &loaders()
bool register_loader(const std::string &name, loader_creator loader)
BaseLoader_unique find_loader(const std::string &name, MPI_Comm comm = PETSC_COMM_WORLD)

Protected Attributes

MPI_Comm _comm
std::string _path
intvector _shape

Private Static Attributes

std::unique_ptr<BaseLoader::loader_map> _loaders = std::make_unique<BaseLoader::loader_map>()
class BaseWriter
#include <basewriter.hpp>

Subclassed by HDFWriter, OIIOWriter

Public Types

using writer_creator = std::function<BaseWriter_unique(const std::string &path, MPI_Comm comm)>
using creator_map = std::map<std::string, writer_creator>
using extension_map = std::map<std::string, std::string>
using string_pair = std::pair<std::string, std::string>

Public Functions

BaseWriter(const std::string &filespec, const MPI_Comm &comm = PETSC_COMM_WORLD)
virtual ~BaseWriter()
virtual std::string write_image(const Image &image) = 0
virtual std::string write_map(const Map &map) = 0

Public Static Functions

template<typename WriterClass>
static BaseWriter_unique create_writer(const std::string &path, MPI_Comm comm)
template<typename WriterClass>
bool register_writer()
std::string find_writer_for_filename(const std::string &filename)
BaseWriter_unique get_writer_by_name(const std::string &name, const std::string &filename, MPI_Comm comm = PETSC_COMM_WORLD)
BaseWriter_unique get_writer_for_filename(const std::string &filename, MPI_Comm comm = PETSC_COMM_WORLD)
BaseWriter::string_pair split_filespec(std::string input)
bool check_truncated(const std::string &filename)
void mark_truncated(std::string filename)

Public Static Attributes

const std::string writer_name = "Basewriter"
const std::vector<std::string> extensions

Protected Attributes

std::string filename
std::string extra_path
MPI_Comm _comm

Protected Static Attributes

const std::vector<std::string> _components

Private Static Attributes

std::unique_ptr<BaseWriter::creator_map> _creators = std::make_unique<BaseWriter::creator_map>()
std::unique_ptr<BaseWriter::extension_map> _extension_handlers = std::make_unique<BaseWriter::extension_map>()
std::unique_ptr<stringset> _truncated_files = std::make_unique<stringset>()
class ConfigurationBase
#include <baseconfiguration.hpp>

Subclassed by IniConfig, ShirtConfig

Public Functions

template<typename T>
std::enable_if<std::is_same<T, bool>::value, T>::type grab(const std::string key) const
template<typename T>
std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value, T>::type grab(const std::string key) const
template<typename T>
std::enable_if<std::is_floating_point<T>::value && !std::is_same<T, bool>::value, T>::type grab(const std::string key) const
template<typename T>
std::enable_if<std::is_same<T, std::string>::value, T>::type grab(std::string key) const
void validate_config()

Public Static Functions

std::string get_invocation_name(const std::string &argzero)

Public Static Attributes

const std::string k_stem_token = "%name%"
const std::string k_extension_token = "%ext%"
const std::string k_outer_token = "%s%"
const std::string k_inner_token = "%i%"

Protected Functions

ConfigurationBase(const int &argc, char const *const *argv)

Protected Attributes

config_map config
std::vector<std::string> arguments
std::string invocation_name

Protected Static Attributes

const std::vector<std::string> required_options = {"fixed", , }
const config_map ConfigurationBase::arg_options= {{"fixed", ""}, {"moved", ""}, {"nodespacing", ""}, {"registered", "registered.xdmf"}, {"map", "map.xdmf"}, {"lambda", "auto"}, {"mask", ""}, {"registered_h5_path", "/registered"}, {"map_h5_path", "/map"}, {"lambda_mult", "1.0"}, {"intermediate_template", "%name%-intermediate-%s%-%i%%ext%"}, {"intermediate_map_template", "%name%-intermediate-map-%s%-%i%%ext%"}, {"intermediate_directory", "intermediates"}, {"max_iterations", "100"}}
const config_map ConfigurationBase::bool_options= { {"verbose", "false"}, {"with_memory", "true"}, {"save_intermediate_frames", "false"}}
class DCMLoader : public BaseLoader
#include <dcmloader.hpp>

Public Functions

DCMLoader(const std::string &path, MPI_Comm comm = PETSC_COMM_WORLD)
~DCMLoader()
void copy_scaled_chunk(floating ***data, const intvector &size, const intvector &offset) const

Public Static Functions

BaseLoader_unique Create_Loader(const std::string &path, MPI_Comm comm)

Public Static Attributes

const std::string loader_name = "DICOM"

Private Members

DcmFileFormat _datafile
struct DMDeleter
#include <types.hpp>

Public Functions

void operator()(DM *v) const
class Elastic
#include <elastic.hpp>

Public Functions

Elastic(const Image &fixed, const Image &moved, const Mask &mask, const floatvector nodespacing, const ConfigurationBase &configuration)
void autoregister()
std::shared_ptr<Image> registered() const
void save_debug_frame(integer ocount, integer icount)
void save_debug_map(integer ocount, integer icount)
void innerloop(integer outer_count)
void innerstep(integer inum, bool recalculate_lambda)
floating approximate_optimum_lambda(Mat &mat_a, Mat &mat_b, floating lambda_mult, floating initial_guess, floating search_width, uinteger max_iter, floating lambda_min)
void calculate_node_spacings()
void calculate_tmat(integer inum)

Public Members

integer m_max_iter = 50
floating m_convergence_thres = 0.1
MPI_Comm m_comm
const ConfigurationBase &configuration
integer m_imgdims
integer m_mapdims
integer m_size
integer m_iternum
const Image &m_fixed
const Image &m_moved
const Mask &m_mask
floating m_lambda
floatvector2d m_v_nodespacings
floatvector m_v_final_nodespacing
std::shared_ptr<Image> m_p_registered
std::unique_ptr<Map> m_p_map
std::shared_ptr<WorkSpace> m_workspace
Mat_unique normmat

Public Static Attributes

constexpr floating k_lambda_default = 10
constexpr floating k_lambda_min = 2
class FileNotFoundError : public pFIREExpectedError
#include <exceptions.hpp>

Public Functions

FileNotFoundError(const std::string &path, std::string file = "unknown", size_t line_num = 0)

Protected Static Functions

static std::string build_errstring(const std::string &path)
class HDFWriter : public BaseWriter
#include <hdfwriter.hpp>

Subclassed by XDMFWriter

Public Functions

HDFWriter(const std::string &filename, const MPI_Comm &comm)
~HDFWriter()
std::string write_image(const Image &image)
std::string write_map(const Map &map)

Public Static Attributes

const std::string writer_name = "hdf5"
const std::vector<std::string> extensions = {".h5"}

Protected Attributes

std::string h5_filename
std::string h5_groupname

Private Functions

void open_or_create_h5()
void write_1d_dataset_rank0(hsize_t nval, const std::string &groupname, const floating *databuf)
void write_3d_dataset_parallel(uinteger ndim, const std::vector<hsize_t> &fullshape, const std::vector<hsize_t> &chunkshape, const std::vector<hsize_t> &offset, const std::string &groupname, Vec &datavec)

Private Members

hid_t _file_h
class Image : public ImageBase
#include <image.hpp>

Public Functions

Image(const intvector &shape, MPI_Comm comm = PETSC_COMM_WORLD)

Public Static Functions

std::unique_ptr<Image> load_file(const std::string &filename, const ImageBase *existing = nullptr, MPI_Comm comm = PETSC_COMM_WORLD)
std::unique_ptr<Image> duplicate(const ImageBase &img)
std::unique_ptr<Image> copy(const ImageBase &img)

Protected Functions

Image(const ImageBase &image)
Image &operator=(const ImageBase &image)
class ImageBase
#include <imagebase.hpp>

Subclassed by Image, Mask

Public Functions

ImageBase(const intvector &shape, MPI_Comm comm = PETSC_COMM_WORLD)
MPI_Comm comm() const
uinteger ndim() const
const intvector &shape() const
integer size() const
std::shared_ptr<const Vec> global_vec() const
std::shared_ptr<const Vec> local_vec() const
std::shared_ptr<DM> dmda() const
const floating *get_raw_data_ro() const
void release_raw_data_ro(const floating *&ptr) const
void copy_data(const ImageBase &img)
Vec_unique get_raw_data_row_major() const
Vec_unique get_raw_data_natural() const
Vec_unique gradient(integer dim)
floating normalize()
floating masked_normalize(const Mask &mask)
void binarize()
template<typename inttype>
std::vector<inttype> mpi_get_offset() const
template<typename inttype>
std::vector<inttype> mpi_get_chunksize() const
Vec_unique scatter_to_zero() const
floating mutual_information(const ImageBase &other)

Calculate mutual information between this and a second image.

The two images must share a DMDA.

Return

The mutual information between images

Parameters
  • other: the second image for mutual information calculation

Public Static Functions

static std::unique_ptr<Image> duplicate(const ImageBase &img)
static std::unique_ptr<Image> copy(const ImageBase &img)

Protected Functions

void update_local_from_global()
ImageBase(const ImageBase &image)
ImageBase &operator=(const ImageBase &image)
void initialize_dmda()
void initialize_vectors()

Protected Attributes

MPI_Comm m_comm
uinteger m_ndim
intvector m_shape
Vec_shared m_localvec
Vec_shared m_globalvec
DM_shared m_dmda
integer instance_id

Protected Static Attributes

integer instance_id_counter = 0

Private Members

const size_t mi_resolution = 100
struct ImageCacheDeleter

Public Functions

void operator()(OIIO::ImageCache *p) const
template<class T, class charT = char, class traits = std::char_traits<charT>>
class infix_ostream_iterator : public std::iterator<std::output_iterator_tag, void, void, void, void>
#include <infix_iterator.hpp>

Public Types

typedef charT char_type
typedef traits traits_type
typedef std::basic_ostream<charT, traits> ostream_type

Public Functions

infix_ostream_iterator(ostream_type &s)
infix_ostream_iterator(ostream_type &s, charT const *d)
infix_ostream_iterator<T, charT, traits> &operator=(T const &item)
infix_ostream_iterator<T, charT, traits> &operator*()
infix_ostream_iterator<T, charT, traits> &operator++()
infix_ostream_iterator<T, charT, traits> &operator++(int)

Private Members

std::basic_ostream<charT, traits> *os
std::basic_string<charT> delimiter
std::basic_string<charT> real_delim
class IniConfig : public ConfigurationBase
#include <iniconfiguration.hpp>

Public Functions

IniConfig(const int &argc, char const *const *argv)
std::string usage()

Public Static Functions

bool valid_invocation(std::string &inv)

Protected Functions

void parse_arguments()
void read_config_file(const std::string &config_path)
class InternalError : public pFIREBaseError
#include <exceptions.hpp>

Public Functions

InternalError(const std::string &what, std::string file = "unknown", size_t line = 0)

Protected Functions

std::string build_errstring(const std::string &what, const std::string &file, size_t line)
class InvalidLoaderError : public pFIREExpectedError
#include <exceptions.hpp>

Public Functions

InvalidLoaderError(const std::string &path, std::string file = "unknown", size_t line_num = 0)

Protected Static Functions

static std::string build_errstring(const std::string &path)
class InvalidWriterError : public pFIREExpectedError
#include <exceptions.hpp>

Public Functions

InvalidWriterError(const std::string &msg, std::string file = "unknown", size_t line = 0)
struct ISDeleter
#include <types.hpp>

Public Functions

void operator()(IS *v) const
struct KSPDeleter
#include <types.hpp>

Public Functions

void operator()(KSP *v) const
class Map
#include <map.hpp>

Public Functions

Map(floatvector node_spacing, const Mask &mask)
Mat *basis() const
Mat *laplacian() const
const floatvector2d node_locs() const
const MPI_Comm &comm() const
uinteger ndim() const
const intvector &shape() const
const intvector &image_shape() const
const floatvector &spacing() const
integer size() const
Vec &displacements() const
floatvector low_corner() const
std::pair<integer, integer> get_displacement_ownershiprange() const
const floating *get_raw_data_ro() const
void release_raw_data_ro(const floating *&ptr) const
void update(const Vec &delta_vec)
std::unique_ptr<Map> interpolate(const floatvector &new_spacing)
std::unique_ptr<Image> warp(const Image &image, WorkSpace &wksp)
std::pair<intvector, intvector> get_dmda_local_extents() const
Vec_unique get_single_dim_natural(uinteger dim) const
Vec_unique get_single_dim_petsc(uinteger dim) const
Vec_unique get_raw_data_row_major(uinteger dim) const
void print_dm_info()
void apply_mask_to_basis()
void alloc_displacements()
void initialize_dmda() const
void calculate_node_info()
void calculate_basis()
void calculate_laplacian()
void calculate_warp_matrix()
Vec_unique calculate_map_mask(Vec &stacked_mask)

Public Members

MPI_Comm m_comm
const Mask &m_mask
uinteger m_ndim
floatvector m_v_node_spacing
floatvector m_v_offsets
intvector m_v_image_shape
intvector map_shape
floatvector2d m_vv_node_locs
Mat_unique m_basis
Mat_unique m_lapl
Vec_unique m_displacements
DM_unique map_dmda

Public Static Functions

intvector calculate_map_shape(intvector const &image_shape, floatvector const &nodespacing)
class Mask : public ImageBase
#include <mask.hpp>

Public Functions

Mask(const intvector &shape, MPI_Comm comm = PETSC_COMM_WORLD)
integer npoints() const

Public Static Functions

std::unique_ptr<Mask> duplicate(const ImageBase &img)
std::unique_ptr<Mask> copy(const ImageBase &img)
std::unique_ptr<Mask> full_image(const ImageBase &img)
std::unique_ptr<Mask> load_file(const std::string &filename, const ImageBase *existing = nullptr, MPI_Comm comm = PETSC_COMM_WORLD)

Protected Functions

Mask(const ImageBase &mask)
struct MatDeleter
#include <types.hpp>

Public Functions

void operator()(Mat *v) const
class OIIOLoader : public BaseLoader
#include <oiioloader.hpp>

Public Functions

OIIOLoader(const std::string &path, MPI_Comm comm = PETSC_COMM_WORLD)
~OIIOLoader()
void copy_scaled_chunk(floating ***data, const intvector &size, const intvector &offset) const

Public Static Functions

BaseLoader_unique Create_Loader(const std::string &path, MPI_Comm comm)

Public Static Attributes

const std::string loader_name = "OIIO"

Private Static Attributes

ImageCache_unique cache
class OIIOWriter : public BaseWriter
#include <oiiowriter.hpp>

Public Functions

OIIOWriter(std::string filename, const MPI_Comm &comm = PETSC_COMM_WORLD)
~OIIOWriter()
std::string write_image(const Image &image)
std::string write_map(const Map &map)

Public Static Attributes

const std::string writer_name = "OpenImageIO"
const std::vector<std::string> extensions = {".png", , , }
class pFIREBaseError : public std::runtime_error
#include <exceptions.hpp>

Subclassed by InternalError, pFIREExpectedError

Public Functions

pFIREBaseError(const std::string &msg, const std::string &file, size_t line_num)
const char *where()

Protected Attributes

std::string _where

Protected Static Functions

static std::string build_wherestring(const std::string &file, size_t line_num)
static std::string build_errstring(const std::string &what)
class pFIREExpectedError : public pFIREBaseError
#include <exceptions.hpp>

Subclassed by BadConfigurationError, FileNotFoundError, InvalidLoaderError, InvalidWriterError, WriterError

Public Functions

pFIREExpectedError(const std::string &msg, const std::string &file, size_t line_num)
class ShirtConfig : public ConfigurationBase
#include <shirtemulation.hpp>

Public Functions

ShirtConfig(const int &argc, char const *const *argv)
std::string usage()

Public Static Functions

bool valid_invocation(std::string &inv)

Protected Functions

void parse_arguments()

Protected Static Attributes

const std::vector<std::string> shirt_synonyms = {"shirt", }
class ShIRTLoader : public BaseLoader
#include <shirtloader.hpp>

Public Functions

ShIRTLoader(const std::string &path, MPI_Comm comm = PETSC_COMM_WORLD)
~ShIRTLoader()
void copy_scaled_chunk(floating ***data, const intvector &size, const intvector &offset) const

Public Static Functions

BaseLoader_unique Create_Loader(const std::string &path, MPI_Comm comm)

Public Static Attributes

const std::string loader_name = "ShIRT"

Private Types

enum shirt_file_type

Values:

undef = 0
image = 1
mask = 2
using shirt_header_dtype = int32_t
using image_data_dtype = float
using mask_data_dtype = int16_t

Private Functions

intvector read_and_validate_image_header(const MPI_File &fh)
intvector read_and_validate_mask_header(const MPI_File &fh)
void copy_chunk_image(floating ***data, const std::vector<int> &subsize, const std::vector<int> &starts) const
void copy_chunk_mask(floating ***data, const std::vector<int> &subsize, const std::vector<int> &starts) const

Private Members

shirt_file_type _file_type

Private Static Attributes

constexpr MPI_Datatype image_data_mpi_type = MPI_FLOAT
constexpr integer image_header_length = 4
constexpr integer image_header_bytes = image_header_length * sizeof(shirt_header_dtype)
constexpr MPI_Datatype mask_data_mpi_type = MPI_SHORT
constexpr integer mask_header_length = 3
constexpr integer mask_header_bytes = mask_header_length * sizeof(shirt_header_dtype)
struct VecDeleter
#include <types.hpp>

Public Functions

void operator()(Vec *v) const
struct VecScatterDeleter
#include <types.hpp>

Public Functions

void operator()(VecScatter *v) const
class WorkSpace
#include <workspace.hpp>

Public Functions

WorkSpace(const Image &image, const Map &map)
void reallocate_ephemeral_workspace(const Map &map)
void scatter_stacked_to_grads()
void scatter_grads_to_stacked()
void duplicate_single_grad_to_stacked(size_t idx)
void scatter_stacked_to_grads_noreorder()
void allocate_persistent_workspace()
void create_reordering_scatterers()
void create_nonreordering_scatterers()

Public Members

friend WorkSpace::Elastic
friend WorkSpace::Map
MPI_Comm m_comm
DM_shared m_dmda
integer m_size
std::vector<Vec_unique> m_globaltmps
std::vector<IS_unique> m_iss
std::vector<VecScatter_unique> m_r_scatterers
std::vector<VecScatter_unique> m_nr_scatterers
Vec_unique m_stacktmp
Vec_unique m_localtmp
Vec_unique m_delta
Vec_unique m_rhs
Mat_unique m_tmat
integer ephemeral_count
class WriterError : public pFIREExpectedError
#include <exceptions.hpp>

Public Functions

WriterError(const std::string &msg, std::string file = "unknown", size_t line = 0)
class XDMFWriter : public HDFWriter
#include <xdmfwriter.hpp>

Public Functions

XDMFWriter(std::string filespec, const MPI_Comm &comm)
~XDMFWriter()
std::string write_image(const Image &image)
std::string write_map(const Map &map)

Public Static Attributes

const std::string writer_name = "xdmf"
const std::vector<std::string> extensions = {".xdmf"}

Protected Attributes

int rank
std::string xdmf_filename
std::string xdmf_groupname
pt::ptree xdmf_tree

Protected Static Functions

std::string h5name_from_xdmfname(const std::string &filename)

Private Functions

void prepopulate_xdmf_ptree()
namespace fd

Functions

Vec_unique gradient_to_global_unique(const DM &dmda, const Vec &localvec, integer dim)
void gradient_existing(const DM &dmda, const Vec &src, Vec &tgt, integer dim)
namespace std

STL namespace.

file banner.cpp
#include “banner.hpp”

Variables

const std::string kbanner_text_upper= R"( ................................................. ...................... :####################::########::################: :####################: :####################::########::######:"""":#####: :####################: :######:""""""":####: :######: :#####: :#####: :######:""""""":####:..... ......... :#####: """""" :####: :####: :#####: :#####: """""":####...#########: :#####: :####: :####: :#####: :#####::#################: :######:......... :####: :####:....:#####: :######:.........::######:""":######: :###############: :####: :#############: :###############: :#####: :#####: :###############: :####: :####:"""":#####: :###############: :#####: :#####: :######"""""""""" :####: :####: :#####: :######:""""""""" :#####: :#####: :#####: :####: :####: :#####: :#####: :#####: :######: :#####: :####: :####: :#####: :#####: ...... :#####:...:#######::#######: :######: :#####: :#####: :######:......:#####: :################::########: :########::######: :#####::####################: :##############: :########: :########::######: :#####::####################: :######:""""""" """""""""" """""""""""""""""" """"""""""""""""""""""""""""" :#####: :#####::#######: )"
const std::string kbanner_text_lower=R"(:#######::#######:""""""""")"
file banner.hpp
#include <string>

Variables

const std::string kbanner_text_upper
const std::string kbanner_text_lower
file baseconfiguration.cpp
#include “baseconfiguration.hpp”#include <sstream>#include “exceptions.hpp”#include “infix_iterator.hpp”
file baseconfiguration.hpp
#include <iostream>#include <iterator>#include <map>#include <sstream>#include <string>#include <string_view>#include <type_traits>#include <vector>#include <boost/filesystem.hpp>#include “types.hpp”#include “exceptions.hpp”

Typedefs

using config_map = std::map<std::string, std::string>
file baseloader.cpp
#include “baseloader.hpp”#include “exceptions.hpp”
file baseloader.hpp
#include <functional>#include <map>#include “types.hpp”

Functions

template<class T, class U>
void norm_convert(U *outptr, const T *inptr, uinteger size, double min, double max)
file basewriter.cpp
#include “basewriter.hpp”#include <string>#include <utility>#include <vector>#include <boost/filesystem.hpp>
file basewriter.hpp
#include <functional>#include <map>#include <string>#include <type_traits>#include <hdf5.h>#include <mpi.h>#include “types.hpp”#include “exceptions.hpp”
file basis.cpp
#include “basis.hpp”#include <petscmat.h>#include “debug.hpp”#include “exceptions.hpp”#include “petsc_debug.hpp”#include “indexing.hpp”#include “iterator_routines.hpp”

Functions

Mat_unique build_basis_matrix(MPI_Comm comm, const intvector &src_shape, const intvector &tgt_shape, const floatvector &scalings, const floatvector &offsets, uinteger ndim, uinteger tile_dim)
Mat_unique build_warp_matrix(MPI_Comm comm, const intvector &img_shape, uinteger ndim, const std::vector<Vec *> &displacements)
file basis.hpp
#include <algorithm>#include <cmath>#include <iterator>#include <numeric>#include <stdexcept>#include “types.hpp”

Functions

Mat_unique build_basis_matrix(MPI_Comm comm, const intvector &src_shape, const intvector &tgt_shape, const floatvector &scalings, const floatvector &offsets, uinteger ndim, uinteger tile_dim)
Mat_unique build_warp_matrix(MPI_Comm comm, const intvector &img_shape, uinteger ndim, const std::vector<Vec *> &displacements)
template<class Input1, class Input2, class Rtype = typename std::iterator_traits<Input1>::value_type>
Rtype calculate_basis_coefficient(Input1 first1, Input1 last1, Input2 first2)
floating clamp_to_edge(floating idx, integer dimsize)
file dcmloader.cpp
#include “dcmloader.hpp”#include <dcmtk/config/osconfig.h>#include <dcmtk/dcmdata/dctagkey.h>#include <dcmtk/dcmdata/dctk.h>#include <dcmtk/dcmimgle/dcmimage.h>#include “exceptions.hpp”#include “file_utils.hpp”

Functions

constexpr unsigned int TG_IMG(0x0028)
constexpr unsigned int TE_ROWS(0x0010)
constexpr unsigned int TE_COLS(0x0011)
constexpr unsigned int TE_FRAMES(0x0008)

Variables

constexpr uinteger METADATA_MAX_BYTES = 4 * 1024
file dcmloader.hpp
#include <dcmtk/config/osconfig.h>#include <dcmtk/dcmdata/dctk.h>#include “baseloader.hpp”#include “types.hpp”
file debug.cpp
#include “debug.hpp”#include <iomanip>#include <iostream>

Functions

void matrix_dbg_print(const MPI_Comm &comm, const Mat &mat, const std::string &name)
file debug.hpp
#include <string>#include <petscmat.h>#include “types.hpp”

Functions

void matrix_dbg_print(const MPI_Comm &comm, const Mat &mat, const std::string &name)
file elastic.cpp
#include “elastic.hpp”#include <iomanip>#include <sstream>#include <boost/filesystem.hpp>#include <boost/format.hpp>#include “basewriter.hpp”#include “fd_routines.hpp”#include “file_utils.hpp”#include “infix_iterator.hpp”#include “iterator_routines.hpp”#include “math_utils.hpp”#include “petsc_debug.hpp”
file elastic.hpp
#include <algorithm>#include <iostream>#include <petscdmda.h>#include <petscmat.h>#include “baseconfiguration.hpp”#include “image.hpp”#include “map.hpp”#include “types.hpp”#include “workspace.hpp”
file exceptions.cpp
#include “exceptions.hpp”#include <chrono>#include <iostream>#include <thread>#include <mpi.h>#include “gitstate.hpp”#include “versioning.hpp”

Functions

void abort_with_unhandled_error()
void sigterm_handler(int signal)
void print_abort_message()

Variables

constexpr std::string_view abort_info_pre= R"FATAL(!!! FATAL ERROR !!!:An unhandled exception has occured within the program. This should not have happened and is probably a bug.Help is available through the pFIRE issue tracker on github, but first please ensure:1. You are using the most recent pFIRE release (check https://github.com/INSIGNEO/pFIRE/releases)2. Your input files are not corrupt3. If you are running on HPC please check there are no hardware issuesIf you have checked the above and the bug still occurs please report it via https://github.com/INSIGNEO/pFIRE/issuesYour report should include:- Input configuration file- Details of the images being registered (format, dimensions)- Basic hardware details, operating system and version- The exact pFIRE version: - )FATAL"
constexpr std::string_view abort_info_libheader= R"FATAL(- The library versions in use:)FATAL"
constexpr std::string_view abort_info_petsc = " - Petsc Version: "
constexpr std::string_view abort_info_boost = " - Boost Version: "
constexpr std::string_view abort_info_post= R"FATAL()FATAL"
file exceptions.hpp
#include <sstream>#include “types.hpp”

Functions

void abort_with_unhandled_error()
void sigterm_handler(int signal)
void print_abort_message()
file fd_routines.cpp
#include “fd_routines.hpp”#include “exceptions.hpp”
file fd_routines.hpp
#include <exception>#include <memory>#include <petscdmda.h>#include <petscvec.h>#include “petsc_helpers.hpp”#include “types.hpp”
file file_utils.cpp
#include “file_utils.hpp”#include <boost/filesystem.hpp>#include “exceptions.hpp”

Functions

void throw_if_nonexistent(const std::string &filepath)
void replace_token(std::string &str, const std::string &token, const std::string &replacement)
void ensure_directories_exist(const std::string &path)
file file_utils.hpp
#include <string>

Functions

void throw_if_nonexistent(const std::string &filepath)
void replace_token(std::string &str, const std::string &token, const std::string &replacement)
void ensure_directories_exist(const std::string &dirpath)
file gitstate.cpp
#include “gitstate.hpp”

Variables

const std::string kGitTag = ""
const std::string kGitSHA = "edf69b1ea967c222f3f32ed26ca9d57e1980a1ba"
const bool kGitDirty = true
file gitstate.hpp
#include <string>

Functions

std::string git_commit_string()
std::string git_version_string()

Variables

const std::string kGitTag
const std::string kGitSHA
const bool kGitDirty
file hdfwriter.cpp
#include “hdfwriter.hpp”#include <algorithm>#include <sstream>#include “image.hpp”#include “indexing.hpp”#include “infix_iterator.hpp”#include “map.hpp”
file hdfwriter.hpp
#include <string>#include <hdf5.h>#include <mpi.h>#include “types.hpp”#include “basewriter.hpp”
file image.cpp
#include “image.hpp”#include <algorithm>#include <memory>#include <string>#include <vector>#include <petscdmda.h>#include <petscvec.h>#include “fd_routines.hpp”#include “indexing.hpp”#include “iterator_routines.hpp”#include “map.hpp”#include “math_utils.hpp”#include “baseloader.hpp”
file image.hpp
#include <type_traits>#include <mpi.h>#include “imagebase.hpp”#include “types.hpp”
file imagebase.cpp
#include “image.hpp”#include <algorithm>#include <memory>#include <string>#include <vector>#include <petscdmda.h>#include <petscvec.h>#include “fd_routines.hpp”#include “indexing.hpp”#include “iterator_routines.hpp”#include “map.hpp”#include “math_utils.hpp”#include “exceptions.hpp”#include “baseloader.hpp”
file imagebase.hpp
#include <petscdmda.h>#include “types.hpp”
file indexing.hpp
#include <vector>#include “types.hpp”

Functions

template<typename inttype>
std::vector<inttype> unravel(const inttype &idx, const std::vector<inttype> &shape)
template<typename inttype>
inttype ravel(const std::vector<inttype> &loc, const std::vector<inttype> &shape)
template<typename inttype>
inttype idx_cmaj_to_rmaj(const inttype &idx, const std::vector<inttype> &shape)
file infix_iterator.hpp
#include <iterator>#include <ostream>#include <string>
file iniconfiguration.cpp
#include “iniconfiguration.hpp”#include <cstdlib>#include <iostream>#include <iterator>#include <sstream>#include <string>#include <vector>#include <boost/algorithm/string/case_conv.hpp>#include <boost/program_options.hpp>#include <boost/property_tree/ini_parser.hpp>#include <boost/property_tree/ptree.hpp>
file iniconfiguration.hpp
#include <string>#include <vector>#include “baseconfiguration.hpp”#include “types.hpp”
file iterator_routines.hpp

Functions

template<typename Functor, typename OutputIterator, typename Input1, typename ...Inputs>
OutputIterator n_ary_transform(Functor f, OutputIterator out, Input1 first1, Input1 last1, Inputs... firsts)
template<typename Functor, typename Input1, typename ...Inputs>
Functor n_ary_for_each(Functor f, Input1 first1, Input1 last1, Inputs... firsts)
template<typename InputIt1, typename InputIt2, typename BinaryPredicate>
bool all_true(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, BinaryPredicate p)
template<typename InputIt1, typename InputIt2, typename BinaryPredicate>
bool all_true_varlen(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, BinaryPredicate p)
file laplacian.cpp
#include “laplacian.hpp”#include “indexing.hpp”#include “petsc_debug.hpp”

Functions

Mat_unique build_laplacian_autostride(MPI_Comm comm, intvector shape, integer ndim)
Mat_unique build_laplacian_matrix(MPI_Comm comm, intvector shape, integer startrow, integer endrow, integer ndim)
file laplacian.hpp
#include <numeric>#include <mpi.h>#include <petscmat.h>#include “types.hpp”

Functions

Mat_unique build_laplacian_matrix(MPI_Comm comm, intvector shape, integer startrow, integer endrow, integer ndim)
Mat_unique build_laplacian_autostride(MPI_Comm comm, intvector shape)
file map.cpp
#include “map.hpp”#include <petscis.h>#include <petscvec.h>#include “basis.hpp”#include “image.hpp”#include “indexing.hpp”#include “laplacian.hpp”#include “math_utils.hpp”#include “petsc_helpers.hpp”#include “workspace.hpp”#include “iterator_routines.hpp”
file map.hpp
#include <exception>#include <iostream>#include <numeric>#include <utility>#include “mask.hpp”#include “types.hpp”
file mask.cpp
#include “mask.hpp”#include “baseloader.hpp”#include “iterator_routines.hpp”#include “exceptions.hpp”
file mask.hpp
#include “image.hpp”
file math_utils.cpp
#include “math_utils.hpp”#include <petscdmda.h>

Functions

void quadratic_from_points(floating x_1, floating x_2, floating x_3, floating y_1, floating y_2, floating y_3, floating &a, floating &b, floating &c)
void quadratic_vertex(floating a, floating b, floating c, floating &x, floating &y)
void binarize_vector(Vec &vec, floating thres)
void dilate_dmda(DM &dmda, Vec &vec)
file math_utils.hpp
#include “types.hpp”#include <numeric>#include “exceptions.hpp”

Functions

void quadratic_from_points(floating x_1, floating x_2, floating x_3, floating y_1, floating y_2, floating y_3, floating &a, floating &b, floating &c)
void quadratic_vertex(floating a, floating b, floating c, floating &x, floating &y)
void binarize_vector(Vec &vec, floating thres)
void dilate_dmda(DM &dmda, Vec &vec)
floating mat_size(integer ndim, integer nvox)
void explain_memory(const intvector &image_size, const intvector &map_size)
file oiioloader.cpp
#include “oiioloader.hpp”#include “exceptions.hpp”#include “file_utils.hpp”

Functions

ImageCache_unique create_unique_imagecache()
file oiioloader.hpp
#include <OpenImageIO/imagecache.h>#include “baseloader.hpp”#include “types.hpp”

Typedefs

using ImageCache_unique = std::unique_ptr<OIIO::ImageCache, ImageCacheDeleter>
file oiiowriter.cpp
#include “oiiowriter.hpp”#include <OpenImageIO/imageio.h>#include “image.hpp”#include “exceptions.hpp”
file oiiowriter.hpp
#include <string>#include “basewriter.hpp”
file petsc_debug.hpp
#include <cstdint>

Defines

debug_creation(obj, name)
debug_deletion(obj)

Functions

template<typename PetscXX>
void do_debug_creation(PetscXX &uncast_obj, std::string name, std::string filename, uint32_t linenum)
template<typename PetscXX>
void do_debug_deletion(PetscXX &uncast_obj, std::string filename, uint32_t linenum)
file petsc_helpers.cpp
#include “petsc_helpers.hpp”#include <algorithm>#include <sstream>#include <fenv.h>#include “exceptions.hpp”

Functions

floating diagonal_sum(const Mat &matrix)
bool vecs_equivalent(const Vec &vec1, const Vec &vec2)
void block_precondition(const Mat &normmat, integer size, integer ndim)
floating get_condnum_by_poweriter(const Mat &matrix, floating conv_thres, integer max_iter)
floating get_eigenvalue_by_poweriter(const Mat &matrix, floating conv_thres, integer max_iter)
void repeat_stack(const Vec &subvec, const Vec &stacked)
void repeat_stack_petsc_to_nat(const Vec &subvec, const Vec &stacked, const DM &subvec_dmda)
void copy_nth_from_stack_nat_to_petsc(const Vec &subvec, const Vec &stacked, const DM &subvec_dmda, integer n)
file petsc_helpers.hpp
#include <petscdmda.h>#include <petscvec.h>#include “types.hpp”

Functions

floating diagonal_sum(const Mat &matrix)
bool vecs_equivalent(const Vec &vec1, const Vec &vec2)
void block_precondition(const Mat &normmat, integer size, integer ndim)
floating get_condnum_by_poweriter(const Mat &matrix, floating conv_thres, integer max_iter)
floating get_eigenvalue_by_poweriter(const Mat &matrix, floating conv_thres, integer max_iter)
void repeat_stack(const Vec &subvec, const Vec &stacked)
void repeat_stack_petsc_to_nat(const Vec &subvec, const Vec &stacked, const DM &subvec_dmda)
void copy_nth_from_stack_nat_to_petsc(const Vec &subvec, const Vec &stacked, const DM &subvec_dmda, integer n)
file pfire.cpp
#include <chrono>#include “baseconfiguration.hpp”#include “iniconfiguration.hpp”#include “setup.hpp”#include “shirtemulation.hpp”#include “exceptions.hpp”#include “elastic.hpp”#include “image.hpp”#include “infix_iterator.hpp”#include “laplacian.hpp”#include “map.hpp”#include “types.hpp”#include “math_utils.hpp”#include “xdmfwriter.hpp”

Functions

void mainflow(std::shared_ptr<ConfigurationBase> config)
void usage()
int main(int argc, char **argv)
file setup.cpp
#include “setup.hpp”#include <csignal>#include <petscsys.h>#include <boost/filesystem.hpp>#include “types.hpp”#include “banner.hpp”#include “gitstate.hpp”#include “baseloader.hpp”#include “shirtloader.hpp”#include “exceptions.hpp”#include “basewriter.hpp”#include “hdfwriter.hpp”#include “xdmfwriter.hpp”

Functions

void register_plugins()
void pfire_setup(const std::vector<std::string> &petsc_args, bool silent)
void check_comm_size_and_warn_odd()
void pfire_teardown()
void print_welcome_message()
file setup.hpp
#include <string>#include <vector>

Functions

std::string get_invocation_name(const std::string &argzero)
void pfire_setup(const std::vector<std::string> &petsc_args, bool silent = false)
void check_comm_size_and_warn_odd()
void print_welcome_message()
void pfire_teardown()
file shirtemulation.cpp
#include “shirtemulation.hpp”#include <cstdlib>#include <iostream>#include <sstream>#include <string>#include <vector>#include <boost/algorithm/string/case_conv.hpp>
file shirtemulation.hpp
#include <string>#include <vector>#include “baseconfiguration.hpp”#include “types.hpp”
file shirtloader.cpp
#include “shirtloader.hpp”#include <numeric>#include <sstream>#include “exceptions.hpp”#include “file_utils.hpp”
file shirtloader.hpp
#include “baseloader.hpp”#include “types.hpp”
file types.hpp
#include <iostream>#include <memory>#include <set>#include <string>#include <vector>#include <petscdm.h>#include <petscksp.h>#include <petscmat.h>#include <petscsys.h>#include <petscvec.h>#include “petsc_debug.hpp”

Typedefs

using integer = PetscInt
using intvector = std::vector<integer>
using intvector2d = std::vector<intvector>
using uinteger = unsigned integer
using uintvector = std::vector<uinteger>
using floating = PetscScalar
using floatvector = std::vector<floating>
using floatvector2d = std::vector<floatvector>
using stringset = std::set<std::string>
using BaseLoader_unique = std::unique_ptr<BaseLoader>
using BaseWriter_unique = std::unique_ptr<BaseWriter>
using Vec_unique = std::unique_ptr<Vec, VecDeleter>
using Vec_shared = std::shared_ptr<Vec>
using Mat_unique = std::unique_ptr<Mat, MatDeleter>
using Mat_shared = std::shared_ptr<Mat>
using DM_unique = std::unique_ptr<DM, DMDeleter>
using DM_shared = std::shared_ptr<DM>
using IS_unique = std::unique_ptr<IS, ISDeleter>
using IS_shared = std::shared_ptr<IS>
using VecScatter_unique = std::unique_ptr<VecScatter, VecScatterDeleter>
using VecScatter_shared = std::shared_ptr<VecScatter>
using KSP_unique = std::unique_ptr<KSP, KSPDeleter>
using KSP_shared = std::shared_ptr<KSP>

Functions

Vec_unique create_unique_vec()
Vec_shared create_shared_vec()
Mat_unique create_unique_mat()
Mat_shared create_shared_mat()
DM_unique create_unique_dm()
DM_shared create_shared_dm()
IS_unique create_unique_is()
IS_shared create_shared_is()
VecScatter_unique create_unique_vecscatter()
VecScatter_shared create_shared_vecscatter()
KSP_unique create_unique_ksp()
KSP_shared create_shared_ksp()
file versioning.cpp
#include <petscsys.h>#include <boost/version.hpp>#include “types.hpp”

Functions

std::string get_version_string_petsc()
std::string get_version_string_boost()
file versioning.hpp
#include <string>

Functions

std::string get_version_string_petsc()
std::string get_version_string_boost()
file workspace.cpp
#include “workspace.hpp”
file workspace.hpp
#include “elastic.hpp”#include “image.hpp”#include “types.hpp”
file xdmfwriter.cpp
#include “xdmfwriter.hpp”#include <algorithm>#include <sstream>#include <boost/filesystem.hpp>#include “image.hpp”#include “indexing.hpp”#include “infix_iterator.hpp”#include “map.hpp”
file xdmfwriter.hpp
#include <string>#include <hdf5.h>#include <mpi.h>#include <boost/property_tree/ptree.hpp>#include <boost/property_tree/xml_parser.hpp>#include “hdfwriter.hpp”#include “types.hpp”
dir src