Skip to content

Commit b90cd79

Browse files
committed
DOC: Improve comments
1 parent 153fe6f commit b90cd79

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

niworkflows/interfaces/mni.py

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,32 @@ def _get_ants_args(self):
198198
'initial_moving_transform': self.inputs.initial_moving_transform}
199199

200200
"""
201-
Moving image handling
201+
Moving image handling - The following truth table maps out the intended action
202+
sequence. Future refactoring may more directly encode this.
203+
204+
moving_mask and lesion_mask are files
205+
True = file
206+
False = None
207+
208+
| moving_mask | explicit_masking | lesion_mask | action
209+
|-------------|------------------|-------------|-------------------------------------------
210+
| True | True | True | Update `moving_image` after applying
211+
| | | | mask.
212+
| | | | Set `moving_image_mask` applying
213+
| | | | `create_cfm` with `global_mask=True`.
214+
|-------------|------------------|-------------|-------------------------------------------
215+
| True | True | False | Update `moving_image` after applying
216+
| | | | mask.
217+
|-------------|------------------|-------------|-------------------------------------------
218+
| True | False | True | Set `moving_image_mask` applying
219+
| | | | `create_cfm` with `global_mask=False`
220+
|-------------|------------------|-------------|-------------------------------------------
221+
| True | False | False | args['moving_image_mask'] = moving_mask
222+
|-------------|------------------|-------------|-------------------------------------------
223+
| False | * | True | Set `moving_image_mask` applying
224+
| | | | `create_cfm` with `global_mask=True`
225+
|-------------|------------------|-------------|-------------------------------------------
226+
| False | * | False | No action
202227
"""
203228
# If a moving mask is provided...
204229
if isdefined(self.inputs.moving_mask):
@@ -239,7 +264,32 @@ def _get_ants_args(self):
239264
global_mask=True)
240265

241266
"""
242-
Reference image handling
267+
Reference image handling - The following truth table maps out the intended action
268+
sequence. Future refactoring may more directly encode this.
269+
270+
reference_mask and lesion_mask are files
271+
True = file
272+
False = None
273+
274+
| reference_mask | explicit_masking | lesion_mask | action
275+
|----------------|------------------|-------------|----------------------------------------
276+
| True | True | True | Update `fixed_image` after applying
277+
| | | | mask.
278+
| | | | Set `fixed_image_mask` applying
279+
| | | | `create_cfm` with `global_mask=True`.
280+
|----------------|------------------|-------------|----------------------------------------
281+
| True | True | False | Update `fixed_image` after applying
282+
| | | | mask.
283+
|----------------|------------------|-------------|----------------------------------------
284+
| True | False | True | Set `fixed_image_mask` applying
285+
| | | | `create_cfm` with `global_mask=False`
286+
|----------------|------------------|-------------|----------------------------------------
287+
| True | False | False | args['fixed_image_mask'] = fixed_mask
288+
|----------------|------------------|-------------|----------------------------------------
289+
| False | * | True | Set `fixed_image_mask` applying
290+
| | | | `create_cfm` with `global_mask=True`
291+
|----------------|------------------|-------------|----------------------------------------
292+
| False | * | False | No action
243293
"""
244294
# If a reference image is provided...
245295
if isdefined(self.inputs.reference_image):
@@ -406,6 +456,7 @@ def create_cfm(in_file, lesion_mask=None, global_mask=True, out_path=None):
406456
Path to an existing binary lesion mask.
407457
global_mask : bool
408458
Create a whole-image mask (True) or limit to reference mask (False)
459+
A whole image-mask is 1 everywhere
409460
410461
Returns
411462
-------

0 commit comments

Comments
 (0)