Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roi from model bounds #152

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

amymmorton
Copy link
Contributor

@amymmorton amymmorton commented Dec 11, 2024

A start to the subvolume 3d registration testing, implements the roi generation from model bounds

TO DO:
iterate on all Models | load from file

image

@amymmorton amymmorton requested a review from sbelsk December 11, 2024 21:43
@amymmorton
Copy link
Contributor Author

@sbelsk You can take this and help iterate on it or make another from scratch

TO DO:

  • load stl from file- iterate for all Model nodes
  • use CropVolume
   /// Perform non-interpolated (voxel-based) cropping.
   /// If limitToInputExtent is set to true (default) then the extent can only be smaller than the input volume.
   static int CropVoxelBased(vtkMRMLDisplayableNode* roi, vtkMRMLVolumeNode* inputVolume,
      vtkMRMLVolumeNode* outputNode, bool limitToInputExtent=true, double fillValue=0.0); 

and the generated roi to generate subvolumes

@jcfr
Copy link
Contributor

jcfr commented Dec 11, 2024

Thanks @amymmorton for creating this PR along side issue #151 describing the overall workflow and providing reference to datasets 🙏

@amymmorton
Copy link
Contributor Author

@sbelsk can you help me fix my failing precommit, Commit messages please? :(

@jcfr
Copy link
Contributor

jcfr commented Dec 12, 2024

pre-commit check

The pre-commit failures have been addressed.

commit message check

The commit message check is failing because some commits start with WIP: prefix, this is described here

Addressing this could be done by using git rebase --interactive 06acebe and then editing the "faulty" commit messages. For example WIP: Initial Extension Setup -> ENH: Initial Extension Setup

amymmorton and others added 10 commits December 12, 2024 15:36
From Extension wizard
Currently  broken ui elements module
Tutorial mcode diff example
Content stl file read
Remove mcode examples
TO DO: assign to roi
TO DO: Use model bounds and input Volume to generate subvolume
Loads Models form folder and iteratively generates each roi
Since the base class associated with scripted module class `ScriptedLoadableModuleTest`
is `unittest.TestCase`, using function like assertEqual is legitimate and
should not be replaced with `assert`.

References:
* https://docs.python.org/3/library/unittest.html#unittest.TestCase
* https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
* Remove end of line spaces
* Reorder imports
* Prefer explicit imports instead of "*"
* Add missing spaces
* Add ARG002 linting exceptions for unused "modelBounds" parameters

Most of the fixes where either automatically fixed or identified
running `pre-commit run -a`.
Cleanup commented out irrelevant lines and migrate functionality into logic class
Also corrected signal and slot that link inputVolume ui to MRML scene.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants