Skip to content

Commit

Permalink
sty: use f-string within normalization interface (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban authored Oct 30, 2024
1 parent 1f9a0cf commit 4359700
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions niworkflows/interfaces/norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,11 @@ def _get_settings(self):
NIWORKFLOWS_LOG.info("User-defined settings, overriding defaults")
return self.inputs.settings

# Define a prefix for output files based on the modality of the moving image.
filestart = "{}-mni_registration_{}_".format(
self.inputs.moving.lower(), self.inputs.flavor
)

data_dir = load_data()
# Get a list of settings files that match the flavor.
filenames = [
path.name
for path in data_dir.iterdir()
if path.name.startswith(filestart) and path.name.endswith(".json")
]
# Return the settings files.
return [str(data_dir / f) for f in sorted(filenames)]
return sorted([str(path) for path in data_dir.glob(
f"{self.inputs.moving.lower()}-mni_registration_{self.inputs.flavor}_*.json"
)])

def _run_interface(self, runtime):
# Get a list of settings files.
Expand Down

0 comments on commit 4359700

Please sign in to comment.