From fbe2deeb302d595e3c4c9f1b0c07ebabc0d86ad6 Mon Sep 17 00:00:00 2001
From: Tamino Huxohl <thuxohl@techfak.uni-bielefeld.de>
Date: Fri, 23 Dec 2022 09:37:16 +0100
Subject: [PATCH] document recon filter

---
 mu_map/recon/filter.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/mu_map/recon/filter.py b/mu_map/recon/filter.py
index ffcc956..bc15941 100644
--- a/mu_map/recon/filter.py
+++ b/mu_map/recon/filter.py
@@ -1,5 +1,8 @@
 from mu_map.file.interfile import Interfile, InterfileKeys
 
+"""
+Template for a Gaussian post-filter in a STIR reconstruction. 
+"""
 TEMPLATE_FILTER_GAUSSIAN_PARAMS = """
 post-filter type := Separable Gaussian
 separable gaussian filter parameters :=
@@ -13,9 +16,21 @@ separable gaussian filter parameters :=
 end separable gaussian filter parameters :=
 """
 
+
 class GaussianFilter:
+    """
+    Class handling a Gaussian post-filter in a reconstruction.
+    """
 
     def __init__(self, projection: Interfile, width_scale: int = 1.0):
+        """
+        Initialize a Gaussian post-filter for the reconstruction of a projection.
+
+        :param projection: the projection for which the filter is created
+        :param width_scale: the width of the filter in each dimension is this scale
+               times the spacing defined in the projection
+        :returns: an object which can add this filter to reconstruction parameters
+        """
         header, _ = projection
 
         self.params = TEMPLATE_FILTER_GAUSSIAN_PARAMS
@@ -31,7 +46,13 @@ class GaussianFilter:
         self.params = self.params.replace("{SIZE_Y}", header[InterfileKeys.dim(1)])
         self.params = self.params.replace("{SIZE_Z}", header[InterfileKeys.dim(2)])
 
-    def insert(self, osem_params: str):
+    def insert(self, osem_params: str) -> str:
+        """
+        Inter this filter into a string of OSEM parameters for STIR.
+
+        :param osem_params: the params in which this filter is inserted
+        :return: the params with inserted filter
+        """
         lines = self.params.strip().split("\n")
         lines = list(map(lambda line: "  " + line, lines))
         lines.append("\n")
-- 
GitLab