|
STIR 6.5.0
|
Rebins a SimSET block-detector weight file, binned by crystal pair, into STIR projection data. More...
#include "stir/ProjData.h"#include "stir/ProjDataInMemory.h"#include "stir/ProjDataInfoPETScannerWithDiscreteDetectors.h"#include "stir/DetectionPositionPair.h"#include "stir/Bin.h"#include "stir/Scanner.h"#include "stir/format.h"#include "stir/info.h"#include "stir/warning.h"#include "stir/error.h"#include <algorithm>#include <cstdint>#include <cstdlib>#include <fstream>#include <iostream>#include <string>#include <vector>Functions | |
| int | main (int argc, char **argv) |
Rebins a SimSET block-detector weight file, binned by crystal pair, into STIR projection data.
SimSET run with a block detector and bin_by_crystal = true writes its weights indexed by crystal pair, not by sinogram bin. This utility maps each bin of a STIR template onto its detection position pairs, and sums the corresponding crystal-pair weights.
| output_prefix | outputs are written as output_prefix_<label>.hs |
| template_projdata | projection data describing the scanner and the output sinogram |
| weight_file | SimSET's weight_image_path from the bin.rec file |
| mode | multiples or singles_scat, see below |
The block layout is taken from the template's scanner, which has to agree with the simulated SimSET detector:
det.rec that contain active crystals (rings with only shielding do not count)ring_num_blocks_in_ring in the ring parameter fileWhen every element of the block is an active crystal, the last two are block_layer_num_z_changes + 1 and block_layer_num_y_changes + 1.
floats. How many grids there are was decided at simulation time by the bin.rec file.multiples expects 1 grid (e.g. scatter_param = 5, min_s = max_s = 2), written as label multiples.singles_scat expects 2 grids, [unscattered][single Scatter estimation building blocks] (e.g. scatter_param = 4, min_s = 0, max_s = 1), written as labels unscattered and singles_scat. The number of grids in the file has to match the mode.The views of the output are stored in reverse order (view -> num_views - 1 - view). SimSET's y axis points up (voxel row 0 is at yMax) and STIR's points down, so an image written row by row for SimSET is the same picture in both, with y_SimSET = -y_STIR. Both number their crystals counter-clockwise in their own frame, so seen from the object the two rings are numbered in opposite directions: SimSET crystal k is the mirror image of STIR detector k. Reversing the views undoes this mirror. The exact alignment depends on the template's view offset.