Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use arithmetic in size keywords #9

Merged
merged 3 commits into from
Oct 26, 2023
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ RUN mkdir -p /home/vscode/.local/share/CMakeTools \
&& chown vscode:conda /home/vscode/.local/share/CMakeTools/cmake-tools-kits.json

# Install the yardl tool
ARG YARDL_VERSION=0.3.0
ARG YARDL_VERSION=0.3.1
RUN wget --quiet "https://github.com/microsoft/yardl/releases/download/v${YARDL_VERSION}/yardl_${YARDL_VERSION}_linux_x86_64.tar.gz" \
&& tar -xzf "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz" \
&& mv yardl "/opt/conda/envs/${CONDA_ENVIRONMENT_NAME}/bin/" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
mkdir ${YARDL_DIR}
cd ${YARDL_DIR}
echo "${{github.workspace}}/yardl" >> $GITHUB_PATH
YARDL_VERSION=0.3.0
YARDL_VERSION=0.3.1
wget --quiet "https://github.com/microsoft/yardl/releases/download/v${YARDL_VERSION}/yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
tar -xzf "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
rm "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
Expand Down
2 changes: 2 additions & 0 deletions cpp/prd_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ main(int argc, char* argv[])
if (header.exam) // only do this if present
std::cout << "Subject ID: " << header.exam->subject.id << std::endl;
std::cout << "Number of detectors: " << header.scanner.NumberOfDetectors() << std::endl;
std::cout << "Number of TOF bins: " << header.scanner.NumberOfTOFBins() << std::endl;
std::cout << "Number of energy bins: " <<header.scanner.NumberOfEnergyBins() << std::endl;

const auto& tof_bin_edges = header.scanner.tof_bin_edges;
std::cout << "TOF bin edges: " << tof_bin_edges << std::endl;
Expand Down
5 changes: 2 additions & 3 deletions model/ScannerInformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ ScannerInformation: !record

computedFields:
numberOfDetectors: size(detectors)
# TODO: can we subtract 1 to get the number?
numberP1OfTOFBins: size(tofBinEdges)
numberP1OfEnergyBins: size(energyBinEdges)
numberOfTOFBins: size(tofBinEdges)-1
numberOfEnergyBins: size(energyBinEdges)-1
2 changes: 2 additions & 0 deletions python/prd_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
header = reader.read_header()
print(f"Subject ID: {header.exam.subject.id}")
print(f"Number of detectors: {header.scanner.number_of_detectors()}")
print(f"Number of TOF bins: {header.scanner.number_of_tof_bins()}")
print(f"Number of energy bins: {header.scanner.number_of_energy_bins()}")

energy_bin_edges = header.scanner.energy_bin_edges
print(f"Energy bin edges: {energy_bin_edges}")
Expand Down