Commit 125f41fe authored by Benjy Marks's avatar Benjy Marks
Browse files

fixed doc strings to be compliant

parent ae226b8c
Pipeline #68612 passed with stage
in 1 minute and 29 seconds
......@@ -20,7 +20,8 @@ pages:
- DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential gcc cmake python3-pip python3 python3-dev libeigen3-dev
- pip3 install -U -r requirements.txt
- python3 setup.py install
- sphinx-apidoc -f -o docs/source public
- sphinx-build -b html docs/source public
artifacts:
paths:
- public
......
......@@ -34,7 +34,6 @@ extensions = [
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
'sphinx.ext.napoleon',
'numpydoc',
]
# Add any paths that contain templates here, relative to this directory.
......
......@@ -5,8 +5,8 @@ def DEM_step(locMMin, radiiMM, k=0.5):
"""
Lightweight DEM with assumption of same size spheres as mechanical regularisation
Parameters:
-----------
Parameters
----------
locMMin : Nx3 2D numpy array of floats
xyz positions of spheres in mm, with the origin being the middle of the detector
......@@ -17,8 +17,8 @@ def DEM_step(locMMin, radiiMM, k=0.5):
Stiffness and timestep wrapped into one
Default = 0.1
Returns:
--------
Returns
-------
locMMin : output positions
"""
locMM = locMMin.copy()
......
......@@ -18,8 +18,8 @@ def optimiseSensitivityFields(radioMM, xyzGuessesMM, radiiMM, iterationsMax=20,
synthetic radiograph.
This is done locally in a ROI around each particle, which avoids doing the projection for all pixels.
Parameters:
-----------
Parameters
----------
radioMM : 2D numpy array of floats
Projection of distance crossed in spheres in MM
......@@ -85,8 +85,8 @@ def optimiseSensitivityFields(radioMM, xyzGuessesMM, radiiMM, iterationsMax=20,
Default = None
Returns:
--------
Returns
-------
xzyMM : Corrected positions array
"""
import radioSphere.projectSphere
......@@ -338,8 +338,8 @@ def _optimiseSensitivityFieldsMultiProj(radioMM, xyzGuessesMM, radiiMM, transfor
synthetic radiograph.
This is done locally in a ROI around each particle, which avoids doing the projection for all pixels.
Parameters:
-----------
Parameters
----------
radioMM : 3D numpy array of floats
N Projections of distance crossed in spheres in MM, where N is the number of different views
......@@ -397,8 +397,8 @@ def _optimiseSensitivityFieldsMultiProj(radioMM, xyzGuessesMM, radiiMM, transfor
Perform a soft DEM correction between all iterations?
Default = False
Returns:
--------
Returns
-------
xzyMM : Corrected positions array
"""
import radioSphere.projectSphere
......
......@@ -9,8 +9,8 @@ def pointToDetectorPixelRange(posMM, sourceDetectorDistMM=100, pixelSizeMM=0.1,
The main idea is that it will be used with `ROIaroundSphere` option for projectSphereMM() and in turn singleSphereToDetectorPixelRange()
in order to only project the needed pixels.
Parameters:
-----------
Parameters
----------
posMM : 1x3 2D numpy array of floats
xyz position of sphere in mm, with the origin being the middle of the detector
......@@ -27,8 +27,8 @@ def pointToDetectorPixelRange(posMM, sourceDetectorDistMM=100, pixelSizeMM=0.1,
Number of pixels rows, columns of detector
Default = [512,512]
Returns:
--------
Returns
-------
detectorPixel : tuple
row, column (j,i) coordinate on detector as per figures/projectedCoords_v2.pdf
"""
......@@ -58,8 +58,8 @@ def singleSphereToDetectorPixelRange(spherePositionMM, radiusMM, radiusMargin=0.
The main idea is that it will be used with `ROIaroundSphere` option for projectSphereMM()
in order to only project the needed pixels.
Parameters:
-----------
Parameters
----------
spherePositionMM : 1x3 2D numpy array of floats
xyz position of sphere in mm, with the origin being the middle of the detector
......@@ -95,8 +95,8 @@ def singleSphereToDetectorPixelRange(spherePositionMM, radiusMM, radiusMargin=0.
XYZ transformation matrix to apply to coordinates
Default = None
Returns:
--------
Returns
-------
JIrange : range in rows, colums of detector concerned by this grain
"""
assert((transformationCentreMM is None) == (transformationMatrix is None)), "projectSphere.singleSphereToDetectorPixelRange(): transformationCentreMM and transformationMatrix must both be set or unset"
......@@ -146,8 +146,8 @@ def projectSphereMM(spheresPositionMM, radiiMM, ROIcentreMM=None, ROIradiusMM=No
In order to allow projections from diffferent angles, an XYZ centre and a transformation matrix can be provided,
which will be applied to the particle positions.
Parameters:
-----------
Parameters
----------
spheresPositionMM : Nx3 2D numpy array of floats
xyz positions of spheres in mm, with the origin being the middle of the detector
......@@ -191,8 +191,8 @@ def projectSphereMM(spheresPositionMM, radiiMM, ROIcentreMM=None, ROIradiusMM=No
sigma of blur to pass to scipy.ndimage.gaussian_filter to
blur the radiograph at the end of everything
Returns:
--------
Returns
-------
projectionMM : 2D numpy array of floats
Radiography containing the total crossed distance through the spheres distance in mm for each beam path.
To turn this into a radiography, the distances should be put into a calibrated Beer-Lambert law
......@@ -313,18 +313,18 @@ def projectSphereMM(spheresPositionMM, radiiMM, ROIcentreMM=None, ROIradiusMM=No
def computeLinearBackground(radioMM, mask=None):
"""
This function computes a plane-fit for background greylevels to help with the correction of the background
Parameters:
-----------
Parameters
----------
radioMM : 2D numpy array of floats
The image
mask : 2D numpy array of bools, optional
Masked zone to fit?
Returns:
--------
Returns
-------
background : 2D numpy array of floats
Same size as radioMM
"""
......@@ -348,7 +348,7 @@ def computeLinearBackground(radioMM, mask=None):
def gl2mm(radio, calib=None):
"""
This function takes a greylevel radiograph (I/I0) and returns
This function takes a greylevel radiograph (I/I0) and returns
a radiograph in mm (L), representing the path length encountered.
Parameters
......@@ -366,7 +366,7 @@ def gl2mm(radio, calib=None):
def mm2gl(radioMM, calib=None):
"""
This function takes a radiograph in mm (L) and returns
This function takes a radiograph in mm (L) and returns
a radiograph in greylevels (I/I0)
Parameters
......@@ -380,4 +380,3 @@ def mm2gl(radioMM, calib=None):
if calib is not None:
print("projectSphere.mm2gl() I need to be implemented")
return numpy.exp(-radioMM)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment