Skip to content

Commit 66e4ce6

Browse files
committed
♻️ Move logger import + declaration into guardrail function
1 parent 1190804 commit 66e4ce6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CPAC/registration/guardrails.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# You should have received a copy of the GNU Lesser General Public
1616
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
1717
"""Guardrails to protect against bad registrations"""
18-
import logging
1918
from copy import deepcopy
2019
from nipype.interfaces.ants import Registration
2120
from nipype.interfaces.fsl import FLIRT
@@ -24,7 +23,6 @@
2423
from CPAC.pipeline.nipype_pipeline_engine.utils import connect_from_spec
2524
from CPAC.qc import qc_masks, REGISTRATION_GUARDRAIL_THRESHOLDS
2625

27-
logger = logging.getLogger('nipype.workflow')
2826
_SPEC_KEYS = {
2927
FLIRT: {'reference': 'reference', 'registered': 'out_file'},
3028
Registration: {'reference': 'reference', 'registered': 'out_file'}}
@@ -84,6 +82,8 @@ def registration_guardrail(registered: str, reference: str, retry: bool = False
8482
metrics met specified thresholds?, used as index for selecting
8583
outputs
8684
"""
85+
import logging
86+
logger = logging.getLogger('nipype.workflow')
8787
qc_metrics = qc_masks(registered, reference)
8888
failed_qc = 0
8989
for metric, threshold in REGISTRATION_GUARDRAIL_THRESHOLDS.items():

0 commit comments

Comments
 (0)