Skip to content

Commit

Permalink
Created offset calculations for Catphan604
Browse files Browse the repository at this point in the history
HU linearity module differences
  • Loading branch information
Cody Crewson committed May 24, 2020
1 parent 1230dc7 commit 26fa142
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,4 +1,5 @@
# Folders to ignore
.vscode
env/*
**/pylinac.egg-info
#**/demo_files
Expand All @@ -7,3 +8,4 @@ env/*
#Files to ignore
*.old
.directory

5 changes: 5 additions & 0 deletions pylinac/ct.py
Expand Up @@ -19,6 +19,7 @@
import webbrowser
import zipfile
from typing import Optional
from math import ceil, floor

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -1023,6 +1024,10 @@ def find_origin_slice(self):

if not hu_slices:
raise ValueError("No slices were found that resembled the HU linearity module")
if isinstance(self, CatPhan604):
_604_hu_offset_index_front = int(ceil(5 / self.dicom_stack.metadata.SliceThickness))
_604_hu_offset_index_back = int(ceil(2 / self.dicom_stack.metadata.SliceThickness))
hu_slices = hu_slices[_604_hu_offset_index_front:-_604_hu_offset_index_back]
hu_slices = np.array(hu_slices)
c = int(round(np.median(hu_slices)))
ln = len(hu_slices)
Expand Down

0 comments on commit 26fa142

Please sign in to comment.