Skip to content

Commit 51928d0

Browse files
Format code for readability and clarity
1 parent 001ea40 commit 51928d0

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/imcflibs/imagej/shading.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ def process_files(files, outpath, model_file, fmt):
184184

185185
def simple_flatfield_correction(imp, sigma=20.0):
186186
"""
187-
Performs a simple flatfield correction to a given ImagePlus stack and returns a 32-bit corrected flatfield image.
187+
Performs a simple flatfield correction to a given ImagePlus stack
188+
189+
The function returns a 32-bit corrected flatfield image.
188190
Parameters
189191
----------
190192
imp : ij.ImagePlus
@@ -202,8 +204,11 @@ def simple_flatfield_correction(imp, sigma=20.0):
202204
IJ.run(flatfield, "Gaussian Blur...", sigma_str) # Apply a gaussian blur
203205
stats = StackStatistics(flatfield)
204206
IJ.run(flatfield, "32-bit", "") # Make a 32 bit version of the image
205-
IJ.run(flatfield, "Divide...", "value=" + str(stats.max)) # Normalize 32 bit image to the highest value of original
207+
IJ.run(
208+
flatfield,
209+
"Divide...",
210+
"value=" + str(stats.max)) # Normalize 32 bit image to the highest value of original
206211
ic = ImageCalculator()
207212
flatfield_corrected = ic.run("Divide create", imp, flatfield)
208213

209-
return flatfield_corrected
214+
return flatfield_corrected

0 commit comments

Comments
 (0)