GithubHelp home page GithubHelp logo

slicersalt / itkshape Goto Github PK

View Code? Open in Web Editor NEW
4.0 8.0 3.0 48 KB

ITK-Based Shape Analysis Filters (e.g Procrustes Alignment for Meshes)

License: Apache License 2.0

CMake 6.21% C++ 87.72% Python 6.06%
itk-module shape-analysis

itkshape's Introduction

Slicer SALT site template

About

Project is built on top of Jekyll - simple, blog-aware, static site generator. Jekyll also happens to be the engine behind GitHub Pages, which means you can use Jekyll to host your website from GitHub’s servers for free. Learn more about Jekyll.

Local development

Check if you have all requirements for local environment or consider using this docker image.

To install all development dependencies install Bundler.

    gem install bundler

and run next command from root folder:

  bundle install

To start Jekyll run:

    jekyll serve -w

Site will be available at http://127.0.0.1:4000/directory/ or http://localhost:4000/directory/ (on Windows)

NOTE: in this mode all changes to html and data files will be automatically regenerated, but after changing _config.yml you have to restart server.

Sass(Compass) support

Note: You need to install Node.js

To watch changes of .sass files and compile it to the .css on a fly change property safe: true to safe: false in _config.yml. Note: It works only on local machine, because GitHub runs Jekyll in --save mode

Learn more about Sass development from documentation.

Resource optimizations (optional)

You can optimize images and minify css and javascript automatically (for now only on Windows). But for Mac OS users available amazing tool - imageoptim. Thanks @raphaelsavina for link. Optimize all images by running this script from /automation/images/ folder:

    all_image_optimization.bat -d -jtran -pout -pquant -optip -gsicle -svgo

To minify CSS and JS run minify_js.bat (for Windows) and minify_js.sh (for Linux and MacOS) from /automation/minifying/ folder:

    minify_js.bat

Learn more about available optimization options from documentation.

Documentation

Quick-start guide is not enough? Checkout full documentation.

Contributors

See list of contributors

Maintainers: @tasomaniac and @ozasadnyy.

License

Project is published under the MIT license. Feel free to clone and modify repo as you want, but don't forget to add reference to authors :)

itkshape's People

Contributors

bpaniagua avatar hjmjohnson avatar tbirdso avatar thewtex avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

itkshape's Issues

Wrapping not available

Overview

Python wrapping is not built with the project and is not available as a CMake parameter.

Details

I am seeking to wrap Mesh3DProcrustesAlignFilter class for Python. The external module contains a CMakeLists.txt and .wrap file in the wrapping folder, but no Wrapping folder with Python binaries is built in the ITK-build directory. When setting configuration variables in CMake-GUI there is no WRAP_PYTHON parameter available, and attempting to explicitly set this variable with the CMake CLI has no noticeable impact on the build.

Expected behavior

  • Mesh3DProcrustesAlignFilter_WRAP_PYTHON (or a similar parameter) is available for configuration with CMake
  • Python wrapping is built in ITK-Build/Wrapping

Observed behavior

No wrapping is built

BUG: Filter not accepting mesh input for Python wrapping

Overview

MeshProcrustesAlignFilter builds and is wrapped successfully for template arguments of type itk::Mesh<double, 3>. However, attempting to set input meshes in Python following setting number of inputs returns an error:

>>> filter.SetInput(0,m1)
...
TypeError: in method 'itkMeshProcrustesAlignFilterM3M3_SetInput', argument 3 of type 'itkMeshD3_Pointer'

At face value it seems that there is a type mismatch between the expected argument of type itkMeshD3_Pointer and the given value of type itkMeshD3. However, per Discourse discussion Python is not expected to handle pointers directly.

Steps to Reproduce

  1. Read in valid ITK::mesh<double,3> in Python and validate type:

m1 = itk.meshread('C:/users/tom.birdsong/source/repos/hasi/test/input/901-L-mesh.vtk', itk.D)

type(m1)
<class 'itk.itkMeshBasePython.itkMeshD3'>

  1. Instantiate filter and validate type:

filter = itk.MeshProcrustesAlignFilter[itk.Mesh[itk.D,3], itk.Mesh[itk.D,3]].New()

type(filter)
<class 'itk.itkMeshProcrustesAlignFilterPython.itkMeshProcrustesAlignFilterM3M3'>

  1. Set number of filter inputs (for example, trying to find the mean of two meshes)

filter.SetNumberOfInputs(2)

  1. Attempt to set first mesh input

filter.SetInput(0,m1)

Expected behavior

Setting inputs up to the allocated number in Step 3 succeeds without error.

Observed behavior

Traceback (most recent call last):
File "", line 1, in
TypeError: in method 'itkMeshProcrustesAlignFilterM3M3_SetInput', argument 3 of type 'itkMeshD3_Pointer'

Publish to PyPi

itk-shape has an entry at https://pypi.org/project/itk-shape/ but attempting to install with pip install itk-shape fails:

>pip install itk-shape==0.1.0
ERROR: Could not find a version that satisfies the requirement itk-shape==0.1.0 (from versions: none)
ERROR: No matching distribution found for itk-shape==0.1.0

@thewtex Could you clarify what other steps we need to take to publish a new package to Pypi? Are we missing credentials for this repo?

Note that this isn't a blocking issue, we can build the cxx project against a local ITK build, but it would be useful to have a Python package we can freely install as a testing dependency as we move forward on the HASI Python pipeline.

Wrapped Class Import Failure

Summary

The wrapped itk.Mesh3DProcrustesAlignFilter cannot be instantiated in a Python workspace.

Description

After successfully building the Python wrapping a CTest script is employed to test instantiation of the itk.Mesh3DProcrustesAlignFilter class. Mesh3DProcrustesFilter is available as an ITK module per the following output:

Python 3.8.8 (default, Feb 24 2021, 15:54:32) [MSC v.1928 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import itk
>>> itk.Mesh3DProcrustesAlignFilter
<module 'Mesh3DProcrustesAlignFilter'>
>>> dir(itk.Mesh3DProcrustesAlignFilter)
['Mesh3DProcrustesAlignFilter', '_LazyITKModule__belong_lazy_attributes', 'doc', 'loader', 'name', 'package', 'spec', 'itk_base_global_lazy_attributes', 'loaded_lazy_modules', 'mesh3_d_procrustes_align_filter']

However, attempts to get types or instantiate a filter object fail:

>>> itk.Mesh3DProcrustesAlignFilter.GetTypes()
Traceback (most recent call last):
File "", line 1, in
File "C:\repos\ITK-build\Wrapping\Generators\Python\itk\support\itkLazy.py", line 71, in getattribute
value = types.ModuleType.getattribute(self, attr)
AttributeError: module 'Mesh3DProcrustesAlignFilter' has no attribute 'GetTypes'

>>> itk.Mesh3DProcrustesAlignFilter.New()
Traceback (most recent call last):
File "", line 1, in
File "C:\repos\ITK-build\Wrapping\Generators\Python\itk\support\itkLazy.py", line 71, in getattribute
value = types.ModuleType.getattribute(self, attr)
AttributeError: module 'Mesh3DProcrustesAlignFilter' has no attribute 'New'

Expected behavior

Mesh3DProcrustesAlignFilter can be instantiated according to wrapped types

Observed behavior

Mesh3DProcrustesAlignFilter is available as a Python module but cannot be referenced as a wrapped filter object

CMake errors linking ITK modules

Overview

Initial files in PR 1 fail to build with CMake.

Description

PR 1 adds an ITK external module created with cookiecutter from the ITK external module template, along with header, template, and wrapping files for Mesh3DProcrustesAlignFilter. itk-module.cmake is updated with ITK module dependencies. Attempting to build with CMake yields an error indicating that ITK modules are not linked successfully to allow the headers to be built.

Expected behavior

External module builds without error.

Observed behavior

CDash failures:

include/itkMesh3DProcrustesAlignFilter.h:5:10: fatal error: itkAffineTransform.h: No such file or directory

Contents of CMakeError.log:

Performing Test ITK_UNDEFINED_SYMBOLS_ALLOWED failed with the following output:

(no output follows)

Rename repository

The current repo name ITKMesh3DProcrustesAlignFilter may not be adequately descriptive as support for 2D meshes is added to the ITKMeshProcrustesAlignFilter class. We cannot simply rename the repo to ITKMeshProcrustesAlignFilter as this causes a naming overlap in building the module Python wrapping and renders the wrapped filter class inaccessible.

In now-resolved Issue 5 @thewtex wrote:

I am thinking we should rename the repository / module name to ITKSALT so we can bring in other shape analysis filters. @bpaniagua does that sound good to you?

Note that renaming the repository requires repo edit permissions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.