Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ endif()
# Legacy options
option(STIR_PROJECTORS_AS_V3 "Enable STIR version 3 legacy code" OFF)
option(STIR_LEGACY_IGNORE_VIEW_OFFSET "Ignore using scanner view-offset (or intrinsic azimuthal tilt), as in STIR 4 or earlier" OFF)
option(STIR_ROOT_ROTATION_AS_V4 "Ignore the changes to the ROOT rotation introduced in STIR version 5" OFF)

# NiftyPET projector
if(NOT DISABLE_NiftyPET_PROJECTOR OR NOT DISABLE_Parallelproj_PROJECTOR)
Expand Down
9 changes: 9 additions & 0 deletions documentation/release_5.0.htm
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@ <h3>Backward incompatibities</h3>
scanners, this will fill in the detector maps etc.
You will get a run-time exception if you forgot to do this.
</li>
<li>
Rotational changes to STIR's interface to ROOT files, <a href=https://github.com/UCL/STIR/pull/1012>PR #1012</a>. In previous versions (roughly) half a bucket,
<code>(module_repeater_y * submodule_repeater_y * crystal_repeater_y) /2 - 1)</code>
in the <tt>Cylindrical</tt> case, was subtracted from the crystalIDs, in an attempt to rotate
the scanner. However, this was incompatible with the STIR code to find normalisation factors,
and could be surprising for odd numbers etc.
Rotations should use the new view offset support described above.
Backwards compatibility can be maintained with the CMake switch, <tt>STIR_ROOT_ROTATION_AS_V4</tt>.
</li>
</ul>

<h3>New functionality</h3>
Expand Down
9 changes: 9 additions & 0 deletions src/IO/InputStreamFromROOTFileForCylindricalPET.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ get_next_record(CListRecordROOT& record)

// GATE counts crystal ID =0 the most negative. Therefore
// ID = 0 should be negative, in Rsector 0 and the mid crystal ID be 0 .
#if STIR_ROOT_ROTATION_AS_V4
crystal1 -= half_block;
crystal2 -= half_block;
#endif

// Add offset
crystal1 += offset_dets;
Expand Down Expand Up @@ -146,6 +148,13 @@ InputStreamFromROOTFileForCylindricalPET::set_defaults()
module_repeater_y = -1;
module_repeater_z = -1;
rsector_repeater = -1;
#if STIR_ROOT_ROTATION_AS_V4
half_block = module_repeater_y * submodule_repeater_y * crystal_repeater_y / 2 - 1;
if (half_block < 0 )
half_block = 0;
#else
half_block = 0;
#endif
Comment thread
robbietuk marked this conversation as resolved.
}

void
Expand Down
9 changes: 9 additions & 0 deletions src/IO/InputStreamFromROOTFileForECATPET.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ get_next_record(CListRecordROOT& record)

// GATE counts crystal ID =0 the most negative. Therefore
// ID = 0 should be negative, in Rsector 0 and the mid crystal ID be 0 .
#if STIR_ROOT_ROTATION_AS_V4
crystal1 -= half_block;
crystal2 -= half_block;
#endif

// Add offset
crystal1 += offset_dets;
Expand Down Expand Up @@ -125,6 +127,13 @@ InputStreamFromROOTFileForECATPET::set_defaults()
base_type::set_defaults();
block_repeater_y = -1;
block_repeater_z = -1;
#if STIR_ROOT_ROTATION_AS_V4
half_block = crystal_repeater_y / 2 - 1;
if (half_block < 0 )
half_block = 0;
#else
half_block = 0;
#endif
}

void
Expand Down
1 change: 1 addition & 0 deletions src/cmake/STIRConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ namespace stir {
#endif

#cmakedefine STIR_PROJECTORS_AS_V3
#cmakedefine STIR_ROOT_ROTATION_AS_V4
#cmakedefine STIR_LEGACY_IGNORE_VIEW_OFFSET
#endif // __stir_config__H__