-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from pwadhwa351/ViewOffset
View offset for PET data finally taken into account. WARNING: this PR changes image orientation when view-offset!=0 or when view-mashing is used.
- Loading branch information
Showing
41 changed files
with
454 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Demo of how to use STIR from python to list some scanner properties | ||
|
||
# Copyright 2021 University College London | ||
# Author Kris Thielemans | ||
|
||
# This file is part of STIR. | ||
# | ||
# This file is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This file is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# See STIR/LICENSE.txt for details | ||
|
||
#%% Initial imports | ||
import stir | ||
import math | ||
|
||
#%% get the list of all scanners | ||
l=stir.Scanner.get_names_of_predefined_scanners() | ||
|
||
#%% go through the list to print some properties | ||
for s in l: | ||
sc=stir.Scanner.get_scanner_from_name(s) | ||
if (sc.get_intrinsic_azimuthal_tilt() != 0): | ||
print("{0:30}: intrinsic tilt (degrees): {1:3.2f}".format(sc.get_name(), sc.get_intrinsic_azimuthal_tilt()*180/math.pi)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
correct_projdata Parameters := | ||
|
||
input file := my_prompts.hs | ||
output filename := my_precorrected_sino.hs | ||
input file := my_prompts${suffix}.hs | ||
output filename := my_precorrected_sino${suffix}.hs | ||
; use data (1) or set to one (0) := | ||
apply (1) or undo (0) correction := 1 | ||
randoms projdata filename := my_randoms.hs | ||
randoms projdata filename := my_randoms${suffix}.hs | ||
|
||
Bin Normalisation type := from projdata | ||
Bin Normalisation From ProjData := | ||
; only attenuation here for this simulation | ||
normalisation projdata filename:= my_acfs.hs | ||
normalisation projdata filename:= my_acfs${suffix}.hs | ||
End Bin Normalisation From ProjData:= | ||
|
||
; scatter term to be subtracted AFTER norm+atten correction | ||
; defaults to 0 | ||
;scatter projdata filename := scatter.hs | ||
;scatter projdata filename := scatter${suffix}.hs | ||
|
||
END:= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
correct_projdata Parameters := | ||
|
||
input file := my_line_integrals.hs | ||
output filename := my_prompts.hs | ||
input file := my_line_integrals${suffix}.hs | ||
output filename := my_prompts${suffix}.hs | ||
; use data (1) or set to one (0) := | ||
apply (1) or undo (0) correction := 0 | ||
randoms projdata filename := my_randoms.hs | ||
randoms projdata filename := my_randoms${suffix}.hs | ||
|
||
Bin Normalisation type := from projdata | ||
Bin Normalisation From ProjData := | ||
; only attenuation here for this simulation | ||
normalisation projdata filename:= my_acfs.hs | ||
normalisation projdata filename:= my_acfs${suffix}.hs | ||
End Bin Normalisation From ProjData:= | ||
|
||
; scatter term to be subtracted AFTER norm+atten correction | ||
; defaults to 0 | ||
;scatter projdata filename := scatter.hs | ||
;scatter projdata filename := scatter${suffix}.hs | ||
|
||
END:= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
# Takes an interfile projdata header, and creates a new one with view-offset set to 0. | ||
# | ||
# | ||
# Copyright (C) 2020, University College London | ||
# This file is part of STIR. | ||
# | ||
# This file is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
|
||
# This file is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# See STIR/LICENSE.txt for details | ||
# | ||
# Author: Kris Thielemans | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "Usage: `basename $0` output_filename projdata_interfile_header_filename" | ||
echo "sets view-offset to zero" | ||
echo "Warning: this script is unsafe. It doesn't do any checks at all." | ||
exit 1 | ||
fi | ||
|
||
out_filename=$1 | ||
in_filename=$2 | ||
|
||
set -e | ||
sed -e "s/View offset (degrees).*/View offset (degrees) := 0/" $in_filename > $out_filename |
Oops, something went wrong.