Skip to content

Commit

Permalink
WIP writing brainreg output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed Dec 11, 2024
1 parent b2733e7 commit 189f52b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
13 changes: 10 additions & 3 deletions brainglobe_registration/elastix/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,17 @@ def run_registration(
)[..., ::-1]

if output_directory:
# Remove the deformationField.tiff file generated by elastix
os.unlink(output_directory / "deformationField.tiff")
working_directory = output_directory
else:
os.unlink("deformationField.tiff")
working_directory = Path.cwd()

# Cleanup files generated by elastix
os.remove(working_directory / "deformationField.tiff")
for i in range(len(parameter_lists)):
try:
os.remove(working_directory / f"result.{i}.tiff")
except FileNotFoundError:
continue

return (
np.asarray(result_image),
Expand Down
4 changes: 2 additions & 2 deletions brainglobe_registration/parameters/ara_tools/affine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

//ImageTypes
(FixedInternalImagePixelType "float")
(FixedImageDimension 3)
(FixedImageDimension 2)
(MovingInternalImagePixelType "float")
(MovingImageDimension 3)
(MovingImageDimension 2)

//Components
(Registration "MultiResolutionRegistration")
Expand Down
4 changes: 2 additions & 2 deletions brainglobe_registration/parameters/ara_tools/bspline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

//ImageTypes
(FixedInternalImagePixelType "float")
(FixedImageDimension 3)
(FixedImageDimension 2)
(MovingInternalImagePixelType "float")
(MovingImageDimension 3)
(MovingImageDimension 2)

//Components
(Registration "MultiResolutionRegistration")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
(ResultImageFormat "tiff")
(Transform "AffineTransform")
(WriteIterationInfo "false")
(WriteResultImage "false")
(WriteResultImage "true")
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
(ResultImageFormat "tiff")
(Transform "BSplineTransform")
(WriteIterationInfo "false")
(WriteResultImage "false")
(WriteResultImage "true")
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
(ResultImageFormat "tiff")
(Transform "EulerTransform")
(WriteIterationInfo "false")
(WriteResultImage "false")
(WriteResultImage "true")

0 comments on commit 189f52b

Please sign in to comment.