Skip to content

Commit

Permalink
Merge pull request #106 from bilgelm/speedup2
Browse files Browse the repository at this point in the history
fix nibabel dataobj access for speed up; enable nesma test; ignore jinja2 safety issue
  • Loading branch information
bilgelm authored Sep 5, 2024
2 parents aa32385 + 25f68c6 commit 2e2c5c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
9 changes: 8 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ def safety(session: Session) -> None:
"""Scan dependencies for insecure packages."""
requirements = session.poetry.export_requirements()
session.install("safety")
session.run("safety", "check", "--full-report", f"--file={requirements}")
session.run(
"safety",
"check",
"--full-report",
f"--file={requirements}",
"--ignore",
"70612",
)


@session(python=python_versions)
Expand Down
2 changes: 1 addition & 1 deletion src/dynamicpet/temporalobject/temporalimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(
@property
def dataobj(self) -> NDArray[np.double]:
"""Get dataobj of image."""
return np.asarray(self.img.dataobj, dtype=np.double)
return self.img.get_fdata() # np.asarray(self.img.dataobj, dtype=np.double)

@property
def num_voxels(self) -> int:
Expand Down
1 change: 0 additions & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def test_denoise_hyprlr(images: dict[str, Path]) -> None:
assert os.path.isfile(outputdir / "pet_hyprlr.json")


@pytest.mark.skip(reason="current NESMA implementation is too slow")
def test_denoise_nesma(images: dict[str, Path]) -> None:
"""Test denoise in __main__.py."""
from dynamicpet.__main__ import denoise
Expand Down

0 comments on commit 2e2c5c8

Please sign in to comment.