# Summary of changes in STIR release 1.4 (dated 25/01/2006)

Nearly all work on this update was by Kris Thielemans.
Timothy Borgeaud helped with the updates for Scanner and SinglesRates. Thanks to Oliver Nix for fixes for (and testing with) Visual Studio Express 2005. Thanks to Frédéric Schoenahl for testing with valgrind.

## Summary for endusers (also to be read by developers)

### Known problems

- Currently the implementation if the incremental interpolating backprojector has problems on certain processors due to floating point rounding errors. Intel *86 and PowerPC give correct results, SunSparc and Opteron has a problem at tangential_pos_num==0 (also HP Risc stations give problems). (You would notice problems in the central voxel, which will influence neighboring voxels in the iterative algorithms.) See the User's Guide for details on how to choose another backprojector.
- Currently the implementation if the incremental interpolating backprojector fails when the number of views in not even. Images are wrong, even though the programs might run till the end.
- Images have to have the default number of planes. Trying to forward project images with smaller or larger number of planes will show up some problems, which we thought to have removed already :-/ .
- When specifying shapes (e.g. for generate_image or list_ROI_values), the code to specify Euler angles is buggy (get after set is not consistent). Also, the direction vectors are ignored during parsing.
- OSMAPOSL by default uses a truncation to a cylindrical FOV. However, for even-sized images, this FOV is half a pixel displaced w.r.t. to the origin used in the rest of STIR. The same routine is used in manip_image and compare_image.
- CPU times reported are invalid on Windows 9?, maybe ME as well. They are fine on NT and presumably 2000 and XP. There doesn't seem to be a way to get CPU times in the older Windows versions.

### New utilities

- Some utilities (located in `listmode_utilities`) for viewing info in the .sgl file produced by ECAT HR+ or ECAT EXACT 3D scanners.

### Bugs removed that might affect users

- corrected bug in CListModeData::save_get_position/set_get_position if they were called for the last chunk of the listmode file (where chunk size was determined by buf_size_in_bytes = 8683520). In that case, the repositioning failed and called error() and aborted the program. In normal use, this bug would normally only have appeared if the last frame was very short.
- corrected bug in buildblock/overlap_interpolate.cxx that caused wrong value in the first non-zero output bin if the left edge of the first in_data is to the left of the left edge of the first out_data. This routine is used by `zoom_image`.
- `buildblock/Scanner.cxx`: corrected value written for "distance between rings (cm)" in parameter_info(). This solves a problem in `list_projdata_info` and others.
- `recon_buildblock/ProjMatrixByBinUsingRayTracing.cxx`: corrected a BUG in add_adjacent_z. This function is used for segment 0 in case voxel_size.z() is less than axial_sampling_in_m (e.g. the 'span=1' case). If you were unlucky, a sensitivity to rounding errors could mean that the last plane of voxels contributing to a sinogram was ignored.
- corrected behaviour of the SSRB routines for max_in_segment_num_to_process=-1. Now uses the maximum present in the input data. This fixes a minor problem with FBP2D noticed by Hagen Moelle.
- `utilities/SSRB.cxx` had wrong command line processing. The last argument (max_in_segment_num_to_process) had to be present, but was then ignored (as it was initialised from the previous argument).

### Code changes that influence your results

- The Interfile header for projection data now uses a different convention for the specifying the ring diameter etc. Current keywords are

         inner ring diameter (cm) := ...
         average depth of interaction (cm) := ...
         default bin size (cm) :=
         effective central bin size (cm) :=

  For arc-corrected data, it is the last keyword that is used to set the tangential sampling.
  The previous keywords `ring diameter (cm)` and `bin size` are now ignored. This is done to prevent reading the wrong ring radius etc from old files (see next item).
  If you want to get the same reconstructions as before, set `inner_ring_diameter + 2*average_depth_of_interaction/10` equal to the old `ring_diameter`.
- The ring diameter for most CTI/Siemens scanners is changed. Values now match to what is used by CTI. In particular, an average depth-of-interaction is added to give an effective ring radius. As this changes the scanner dimensions slightly (about 1.5% larger) you will get slightly different values in the reconstructed images. This change will be tiny for arc-corrected data, but somewhat larger for non-arccorrected data (tests indicate again less than 1% difference). Note however that changes in the sensitivity image as used by OSMAPOSL are larger. So, do not re-use existing sensitivity images.
- Sizes such as ring-spacing and bin-size for the GE Discovery ST have changed according to info from Ravindra Manjeshwar (GE Research). The Advance data were ok.
- Reconstruction programs now get the pixel size from `default_bin_size*zoom` (default bin size either specified in the Interfile header or in Scanner.cxx). (It used to be `get_sampling_in_s(Bin(0,0,0,1))` before). This will make a difference in the voxel size when using non-arccorrected data (and with arc-corrected data if the bin size is different from the default value). However, it makes the voxel size consistent between using arc-corrected and non-arccorrected data as input.
- Handling of 3 header fields when writing ECAT7 data has changed somewhat.
  - The `bin_size` field in the main header is now always set to the default_bin_size of the scanner. For sinogram data, the `x_resolution` in the subheader is normally also set to the default bin size. Only for arc-corrected data, the x_resolution is always set to the sampling_in_s.
  - The corrected correspondence between zoom and voxel size in the ECAT7 header to follow the CTI convention, so recon_zoom will now have a slightly different value.
- WARNING: changed format of command line parameters of `fwdtest`to an incompatible format. `fwdtest` can now take a parameter file with the forward projector parameters (similar to `bcktest`). This makes it possible to run complete forward projections without user input (should work by redirecting `stdin` to `/dev/null` such that all questions are answered with their default values).
- WARNING: changed order of command line parameters of `bcktest`.

### New functionality of existing utilities

- added arc-correction to FBP, 3DRP and correct_projdata
- added classes to use ECAT7 normalisation files. You can now normalise and dead-time correct your ECAT7 sinograms.
- changes in the interpolating backprojector allow handling data where the number of views is not a multiple of 4 (such as the Discovery ST).
- added a quadratic prior to be used by OSMAPOSL
- Added data for the GE Discovery STE, GE Discovery RX and Philips Allegro.
- a new option --max_segment_num_to_process to stir_math
- a new option --verbose to postfilter
- a new option -n to conv_to_ecat7 that attempts to fix the scale factor used to 1
- interfile (and in general Array) IO can now use 1-byte integers.

### Code changes that do not influence your results

- removed a bug in listmode classes for ECAT 966 and 962 (function get_detectors), which would have caused your program to crash.
- removed a few bugs in LORCoordinates.inl
- recon_buildblock/RayTraceVoxelsOnCartesianGrid.cxx has changed behaviour when LOR is in a plane between 2 voxels. Previous version had ill-defined behaviour (it would put all results in one or the other, depending on round-errors). Now it stores half of the results in each plane.
- the 'ray tracing' type of 'matrix' for projection uses the above routine and is now more flexible with respect to zooms etc. The previous version aborted when it detected that a line would be in a plane between 2 voxels.
- removed some small memory leaks.
- removed problem in FBP2D, making sure that all variables are initialised (bug spotted by Carole Lartizien)
- code changes to iterators in VectorWithOffset (and hence Arrays etc). They now use some boost classes to have more functionality (e.g. reverse iterators).
- BasicCoordinate objects now take less memory as they no longer allocate an extra element.
- updated boost include files to 1.32.0 and added more boost libraries.

### Installation procedure changes

- Projects for Visual Studio 6 have been updated. Some windows libraries that were never used have been removed. This might make transfer to Visual Studio Express 2005 easier. However, these projects have not been tested for a while. Search the mailing list for more info if you want to try this.

### Documentation changes

- updated doxygen and User's Guide

### recon_test_pack changes

- Added tests for the quadratic prior
- Added tests for conv_to_ecat7 (disabled by default, use --ecat7 to enable)

## What's new for developers (aside from what should be obvious from the above):

### New functionality

- a new hierarchy `SinglesRates` in data_buildblock. This encodes singles rates during a PET scan.
- some extra files for manipulating matrices in `include/stir/numerics`

### Other code changes

- a few small changes to the `CListRecord` hierarchy. You will have to adapt your code (implement set/get_time_in_millisecs and remove set/get_time_in_secs (as now in CListRecord)
- `Scanner` has more members for singles. It also differentiates between the inner ring radius and an effective ring radius (using some average depth of interaction as supplied by the scanner manufacturer). Multiple detector-layer scanners are not really supported though.
- Many files now have explicit copyright statements, but still not all.