Giter Club home page Giter Club logo

simpleitk / simpleitk Goto Github PK

View Code? Open in Web Editor NEW
831.0 831.0 199.0 23.83 MB

SimpleITK: a layer built on top of the Insight Toolkit (ITK), intended to simplify and facilitate ITK's use in rapid prototyping, education and interpreted languages.

Home Page: http://www.simpleitk.org

License: Apache License 2.0

Shell 1.91% CMake 4.77% C++ 36.36% C 0.59% Python 3.82% Lua 0.45% C# 0.09% Java 0.12% R 0.97% Makefile 0.01% Dockerfile 0.02% SWIG 48.45% CSS 0.54% HTML 0.06% Tcl 0.06% TeX 1.78%
c-plus-plus csharp image-analysis image-processing itk java lua python r registration ruby segmentation simpleitk swig tcl

simpleitk's Introduction

SimpleITK

CircleCI GithubActions ReadTheDocs
release CircleCI Batch Build and Test ReadTheDoc
master CircleCI Batch Build and Test ReadTheDoc

SimpleITK is an image analysis toolkit with a large number of components supporting general filtering operations, image segmentation and registration. It is built on top of the Insight Segmentation and Registration Toolkit ITK with the intent of providing a simplified interface to ITK. SimpleITK itself is written in C++ but is available for a large number of programming languages. Currently, these include:

Wrapping of the C++ code is accomplished through SWIG, in principle, any language wrapped by SWIG should be applicable to SimpleITK.

Unlike ITK's support of n-dimensional spatio-temporal images, SimpleITK supports 2D, 3D and 4D images. The dimensionality refers to spatio-temporal dimensions, the voxels can be n-dimensional vectors.

SimpleITK is licensed under the Apache License.

Acknowledgments

SimpleITK development has been supported by:

  • The Intramural Research Program of the National Institutes of Health, National Institute of Allergy and Infectious Diseases.

  • The US National Library of Medicine under the American Recovery and Reinvestment Act (ARRA) and under the Intramural Research Program of the U.S. National Institutes of Health.

  • The Insight Software Consortium and the ITK user and developer communities.

License and Copyright

The SimpleITK project is part of the Insight Software Consortium(ISC) a non-profit educational consortium dedicated to promoting and maintaining open-source, freely available software for bio-medical image analysis. The copyright is held by NumFOCUS. The SimpleITK software is distributed under the Apache License 2.0.

How to Cite

If you found SimpleITK useful in your research, support our efforts by citing the relevant publication(s):

R. Beare, B. C. Lowekamp, Z. Yaniv, "Image Segmentation, Registration and Characterization in R with SimpleITK", J Stat Software, 86(8), https://doi.org/10.18637/jss.v086.i08, 2018.

Z. Yaniv, B. C. Lowekamp, H. J. Johnson, R. Beare, "SimpleITK Image-Analysis Notebooks: a Collaborative Environment for Education and Reproducible Research", J Digit Imaging., 31(3): 290-303, https://doi.org/10.1007/s10278-017-0037-8, 2018.

B. C. Lowekamp, D. T. Chen, L. Ibáñez, D. Blezek, "The Design of SimpleITK", Front. Neuroinform., 7:45. https://doi.org/10.3389/fninf.2013.00045, 2013.

Documentation

With massive libraries like SimpleITK, good documentation is a must. The documentation for SimpleITK is split up into multiple levels:

  1. API Documentation - This contains class and function documentation. The descriptions for functions and classes are primarily borrowed from the original ITK C++ classes.
  2. SimpleITK Documentation - This site contains high-level guides (fundamental SimpleITK concepts, common conventions, etc.), details with respect to the toolkit's binary distributions, instructions for building the toolkit, as well as SimpleITK examples in all supported programming languages. [This site replaced the SimpleITK Wiki which is mostly of interest for historical reasons.]
  3. Jupyter Notebook Repository - This repository contains a collection of Jupyter Notebooks illustrating the use of SimpleITK for educational and research activities. The notebooks demonstrate the use of SimpleITK for interactive image analysis using the Python and R programming languages. Recommended reading, if you are starting with SimpleITK.

Support

SimpleITK provides access to most of the ITK components, but not all. If you are looking for something specific and can't find it, open an issue on GitHub or ask for support on the forum.

Report and Issue or Request a Feature

Please use the issue tracker to report problems or request features.

simpleitk's People

Contributors

addisonelliott avatar aghayoor avatar alessandro-gentilini avatar blezek avatar blowekamp avatar bradking avatar danmuel avatar dave3d avatar davidshq avatar dlrdave avatar gabehart avatar ghisvail avatar hjmjohnson avatar ijm7 avatar jcfr avatar jwj019 avatar kaspermarstal avatar kmader avatar kolibril13 avatar mathstuf avatar mbopfnih avatar n-dekker avatar orsinium avatar philipmac avatar richardbeare avatar thewtex avatar umasehs avatar viktorvdvalk avatar wbzyl avatar zivy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpleitk's Issues

Dicom to stl Conversion

Thank you for making the dicom2stl.py
But I am facing some issues while converting entire dicom directory or zip file.
Single image is converting to stl format, but not entire directory.

Error:
Reading Dicom zip file: Dicom.zip
Error: no series foundctory.

Error:
Traceback (most recent call last):ctory.

Error:
File "dicom2stl.py", line 257, in
img, modality = loadZipDicom( fname[0] )
TypeError: 'NoneType' object is not iterable

How to load entire dicom directory (or) zip format for conversion.(Dicom to stl)? What is the commandline for this conversion?

BMPImageIO supports unsigned char only

Hi, when I am trying to run this SimpleGaussian.cs example, I got this:

System.ApplicationException: Exception thrown in SimpleITK ImageFileWriter_Execute: ..\..\..\..\..\ITK\Modules\IO\BMP\sr
c\itkBMPImageIO.cxx:727:
itk::ERROR: BMPImageIO(000000E0694600E0): BMPImageIO supports unsigned char only
   在 itk.simple.ImageFileWriter.Execute(Image arg0)

The image I set as an input has 3 channels, please tell me how to handle this. Thank you!

The image I used is attached here:
th

Inconsistencies between input types of sitk.Mask and sitk.MaskNegated

https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/json/MaskImageFilter.json#L10

  "pixel_types" : "NonLabelPixelIDTypeList",
  "pixel_types2" : "IntegerPixelIDTypeList",

https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/json/MaskNegatedImageFilter.json

  "pixel_types" : "BasicPixelIDTypeList",

This means that you can have working code with sitk.Mask, and switching to sitk.MaskNegated will break.

In [34]: sitk.Mask(sitk.Image(64, 64, sitk.sitkFloat32),sitk.Image(64, 64, sitk.sitkUInt8))
Out[34]: <SimpleITK.SimpleITK.Image; proxy of <Swig Object of type 'std::vector< itk::simple::Image >::value_type *' at 0x11d4ce900> >

In [35]: sitk.MaskNegated(sitk.Image(64, 64, sitk.sitkFloat32),sitk.Image(64, 64, sitk.sitkUInt8))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-35-36620ed8802d> in <module>()
----> 1 sitk.MaskNegated(sitk.Image(64, 64, sitk.sitkFloat32),sitk.Image(64, 64, sitk.sitkUInt8))

[...]/lib/python3.5/site-packages/SimpleITK/SimpleITK.py in MaskNegated(image, maskImage)
  45785
  45786     """
> 45787     return _SimpleITK.MaskNegated(image, maskImage)
  45788 class MaximumEntropyThresholdImageFilter(ImageFilter_0):
  45789     """

RuntimeError: Exception thrown in SimpleITK MaskNegated: /tmp/simpleitk20160218-43180-pucekk/Code/Common/include/sitkProcessObject.h:277:
sitk::ERROR: Unexpected template dispatch error!

Pixel types are defined here:
https://github.com/SimpleITK/SimpleITK/blob/master/Code/Common/include/sitkPixelIDTypeLists.h

Ideally, sitk.MaskNegated should support the same data types as sitk.Mask.

As a side note, there seems to be a typo in https://github.com/SimpleITK/SimpleITK/blob/master/Code/Common/include/sitkPixelIDTypeLists.h#L168
as "interger" sounds weird. Besides, this TypeList seems unused in the project:

grep -r IntergerLabelPixelIDTypeList *
Code/Common/include/sitkPixelIDTypeLists.h:typedef UnsignedIntegerPixelIDTypeList IntergerLabelPixelIDTypeList;

Add GetPixel Methods to Image

age, we may also want to provide an interface like

v = img[x,y,z]
img[x,y,z] = v

to set or get the value. This is very simply done with

%extend itk::simple::Image {
%pythoncode {
def getitem(self, pos):
return self.GetPixel(*pos)
def setitem(self, pos, val):
self.SetPixel(val, *pos)
}
}

Le 10 févr. 11 à 16:06, Gaëtan Lehmann a écrit :

Le 10 févr. 11 à 15:41, Daniel Blezek a écrit :

Hi Brad,

Just lookup %ignore (which caused Luis much headache last week). I don’t think it uses Glob patterns (which would be dangerous!), so we’ll have to spell everything out.

The methods still have to be available in python, to be able to dispatch the calls.

It should be possible to rename those methods by adding __ before and after the name. Those methods are supposed to be masked in python.

%rename(GetPixelUInt8) itk::simple::Image::GetPixelUInt8
%rename(GetPixelUInt16) itk::simple::Image::GetPixelUInt16
// etc, etc

%extend itk::simple::Image {
%pythoncode {
def GetPixel(self, x, y, z=0):
pixelID = self.GetPixelIDValue()
if pixelID == sitkUInt8:
return self.GetPixelUInt8(x, y, z)
elif pixelID == sitkUInt16:
return self.GetPixelUInt16(x, y, z)
#
# the same for all the pixel types
#
else:
raise Exception("Invalid pixel type: "+str(pixelID))
}
}

-dan

On 2/10/11 8:35 AM, "Bradley Lowekamp" [email protected] wrote:

On Feb 10, 2011, at 9:27 AM, Gaëtan Lehmann wrote:

Le 10 févr. 11 à 14:39, Bradley Lowekamp a écrit :

Hello,

I have been struggling with how to implement the GetPixel methods for stik::Image. I have concluded that we are too confined by C++, so we may need language specific methods.

As many of the languages we are binding to do not have strict typing, I think the best solution would be to take advantage of this for the GetPixel methods. I am imagine in Python one methods that would return a double, int or list of double depending on the internal pimple image type. I have no clue how to do this, but I think it's very important for using simple ITK. Anyone know how to proceed with this type of implementation?

I can say for python.
The call dispatching is done in python, by adding something like that in the .i file:

Thanks! Thank looks surprisingly straight forward.

The one complication I'd like to add is not exposing the GetPixelUInt8 methods. While they may need to be exposed on the C++ interface, I don't think they will be needed for some of the language bindings. Is there a way we can make them protected in the target language but still keep them public in c++?

%extend itk::simple::Image {
%pythoncode {
def GetPixel(self, x, y, z=0):
pixelID = self.GetPixelIDValue()
if pixelID == sitkUInt8:
return self.GetPixelUInt8(x, y, z)
elif pixelID == sitkUInt16:
return self.GetPixelUInt16(x, y, z)
#
# the same for all the pixel types
#
else:
raise Exception("Invalid pixel type: "+str(pixelID))
}
}

Gaëtan

4D image support in SimpleITK

Dear Bradley and friends,

I have long been impressed by the goal and execution of development of this library and you guys have my utmost respect. It solves an important but often overlooked problem is this field, namely making the science-y algorithms user-friendly so the (often not so technical) clinical personnel can actually put them to good use.

I have humbly forked this library to integrate the elastix registration library and ease the learning curve for new elastix users. However, SimpleElastix does not support groupwise registration at the moment because of the lack of support for 4D images in SimpleITK. I recall having read it was a deliberate choice not to support 4D images in order to make the interface as simple as possible. I am less inclined to start hacking away at the robust internal API and would like to know what the prospects are for native 4D support before I start implementing it in SimpleElastix myself?

Compilation problem for MingGW

Hi,

first of all, thanks for the big effor of bringing this library to life, it's amazing!
I am trying to compilethe current master branch of SimpleITK (because I really need urgently the registration part fro Python), but I get the following error during ITK compilation with MingGW 4.6.2:

[ 93%] Building CXX object Modules/IO/TIFF/src/CMakeFiles/ITKIOTIFF.dir/itkTIFFI
mageIO.cxx.obj
c:/SimpleITK/SimpleITK-build-gcc/ITK/Modules/IO/TIFF/src/itkTIFFImageIO.cxx:1:0:
warning: -fPIC ignored for target (all code is position independent) [enabled b
y default]
c:/SimpleITK/SimpleITK-build-gcc/ITK/Modules/IO/TIFF/src/itkTIFFImageIO.cxx: In
member function 'int itk::TIFFReaderInternal::Open(const char_)':
c:/SimpleITK/SimpleITK-build-gcc/ITK/Modules/IO/TIFF/src/itkTIFFImageIO.cxx:74:2
0: error: aggregate 'itk::TIFFReaderInternal::Open(const char_)::stat64 fs64' h
as incomplete type and cannot be defined
c:/SimpleITK/SimpleITK-build-gcc/ITK/Modules/IO/TIFF/src/itkTIFFImageIO.cxx:75:3
3: error: invalid use of incomplete type 'struct itk::TIFFReaderInternal::Open(c
onst char
)::stat64'
c:/SimpleITK/SimpleITK-build-gcc/ITK/Modules/IO/TIFF/src/itkTIFFImageIO.cxx:74:1
2: error: forward declaration of 'struct itk::TIFFReaderInternal::Open(const cha
r
)::_stat64'
make[5]: *** [Modules/IO/TIFF/src/CMakeFiles/ITKIOTIFF.dir/itkTIFFImageIO.cxx.ob
j] Error 1
make[4]: *** [Modules/IO/TIFF/src/CMakeFiles/ITKIOTIFF.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [ITK-prefix/src/ITK-stamp/ITK-build] Error 2
make[1]: *** [CMakeFiles/ITK.dir/all] Error 2
make: *** [all] Error 2

I am using the procedure described here for ITK: http://www.itk.org/Wiki/ITK/Configuring_and_Building/MinGW

My OS is : Windows 7 64-bit.
With VS 2012 Express, it works like a charm.

Am I using a too old compiler?

Thanks

Davide

Windows builds

Need to specify approved/supported Windows compilers and make sure we have a build for them.

Use sitkStaticAssert in Image constructor

Currently a link error occurs when an Image is instantiated which sitk does not support. This needs to be changed to a static assert, so that is becomes a compiler error.

Clarify ITK build dependencies and intro doc.

Hey, I am about to contribute to ITK with a new module (ITKIsotropicWavelet). I shouldn't worry about SimpleITK at this stage, but using sitk in python in just so awesome for fast prototyping, that I want to help with the integration of the module into SimpleITK, and also learn more about swig and wrapping c++.

I am not really sure reading this intro:
http://www.simpleitk.org/SimpleITK/project/about.html about the differences between ITKWrap facilities (from ITK) and SimpleITK.

Also your recommendation about doing a superbuild of SimpleITK doesn't help to know more about what do you need from ITK. I am sure the information is there if I read the CMake files here in github, but a little bit of a intro/explanation would be really appreciated.

Thanks!

Test that filters not run InPlace

If an sitk's internal filter is run in-place then the input date will be stolen and change. This would be a bug. The standard tests for filters must test for this case.

"brew install simpleitk" fails

Installation via homebrew resulted in the following error:

==> Downloading https://downloads.sourceforge.net/project/simpleitk/SimpleITK/0.8.0/Source/SimpleITK-0.8.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/simpleitk-0.8.0.tar.gz
==> cmake . -DCMAKE_C_FLAGS_RELEASE= -DCMAKE_CXX_FLAGS_RELEASE= -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/simpleitk/0.8.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FI
==> make install
/tmp/simpleitk20160210-88654-1y48yu9/SimpleITK-0.8.0/Code/BasicFilters/include/sitkWhiteTopHatImageFilter.h:138: Error: Line indented less than expected (line 4 of pythoncode)
/tmp/simpleitk20160210-88654-1y48yu9/SimpleITK-0.8.0/Code/BasicFilters/include/sitkWhiteTopHatImageFilter.h:148: Error: Line indented less than expected (line 4 of pythoncode)
make[2]: *** [Wrapping/SimpleITKPYTHON_wrap.cxx] Error 229
make[1]: *** [Wrapping/CMakeFiles/SimpleITK_PYTHON.dir/all] Error 2
make: *** [all] Error 2

Lua Bindings as a luarocks package

Hi,

It's great that SimpleITK has lua bindings.
But It's not very clear how to use these bindings in another lua packages like torch. It'd be great if lua bindings are available as a luarocks package. Even better if it can deal with torch tensor.

If such a package is not very hard to create, I can contribute if somebody is willing to guide me.

Thanks,
Sasank.

Add SetCoefficientImages for B-spline transform

Currently the B-spline transform api only supports SetParameters(). It would be very helpful to have the SetCoefficientImages() as well. Is there any reason for not exposing this to the api?

ResampleImageFilter.SetSize() does not accept numpy arrays in Python 3

As reported here, the following code works with Python 2 but not Python 3:

rif = sitk.ResampleImageFilter()
rif.SetSize(np.array([1, 2, 3], dtype='int'))

In Python 3, SimpleITK throws

TypeError: in method 'ResampleImageFilter_SetSize', argument 2 of type 'std::vector< uint32_t,std::allocator< uint32_t > > const &'

Passing dtype='uint32' doesn't help. My temporary workaround is

rif.SetSize(np.array([1, 2, 3], dtype='int').tolist())

I tested with both SimpleITK 0.10.0 and 1.0.0rc1+g57b8f

System:

  • ubuntu 16.04 amd64
  • python 3.5.2 (anaconda)
  • numpy 1.12.0
  • SimpleITK 0.10.0 and 1.0.0rc1+g57b8f

Wish: Expose C++ code to R

I started playing with SimpleITK and R and currently try to create displacement images with each voxel being represented by a 3D vector.
Would it be possible to expose C++ code to R to allow overcoming the slow for loops in R. That way, you could pass the R-data via Rcpp and then call the implemented functions directly (after linking the created dynlib to SimpleITK)..
Best
Stefan

Discussion about documentation

Hi,
Can you please give some instructions to build doxygen documentation of the project?
I tried passing -DBUILD_DOXYGEN:BOOL=ON to cmake superbuild but it doesn't seem to work:

-- Configuring done   
-- Generating done      
CMake Warning:     
CMake Warning:  
  Manually-specified variables were not used by the project:    
                                   
    BUILD_DOXYGEN                          
                                                               
-- Build files have been written to: /home/users/sasank/simpleitk_lua/bb/build

I am thinking of using doxygen xml to create sphinx documentation using breathe.

Thanks in Advance,
Sasank.

PS: It'll be great if you can also upload xml output of doxygen.

How to build a CPP example

Hi,

I'm trying to use simpleitk.h in a CPP file. I was not able to figure out how to build this cpp file.

I have built SimpleITK using instructions from here.

Can somebody please provide me with the g++ flags to compile this cpp file? Please excuse me if this is too basic, but I don't have experience with Cmake.

Sasank.

std::vector< uint64_t >

I'm running into some issues with Swig and the GetSize method in PimpleImageBase that returns a vector. Swig seems to translate std::vector< uint64_t > into std::vector< unsigned long long > which then throws an error in SimpleITKJava_wrap.cxx. I had initially added this method for convenience, but then took it out before merging my branch to master because of the error. It may have gotten put back in when Brad made his updates to my branch (I should have pushed my updated branch to github). Does anyone see either a way to fix this, or if no way exists a reason why we should keep this method?

Reading images concurrently in a threaded setup may result in a segfault

Not quite sure why this is the case, but reading multiple jpeg files concurrently in a threaded setup may result in a segfault. Compare the stacktrace below.

*** Error in `/root/oli/rfl/env/bin/python3': double free or corruption (fasttop): 0x00007fc1046223e0 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x70c4b)[0x7fc1f72fec4b]
/usr/lib/libc.so.6(+0x76fe6)[0x7fc1f7304fe6]
/usr/lib/libc.so.6(+0x777de)[0x7fc1f73057de]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(H5MM_xfree+0xe)[0x7fc174c86ece]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(+0x9470917)[0x7fc174b09917]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(H5E_clear_stack+0x35)[0x7fc174b09a85]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(H5Fis_hdf5+0x2b)[0x7fc174b0c6bb]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(_ZN2H56H5File6isHdf5EPKc+0xd)[0x7fc174aca0fd]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(_ZN3itk11HDF5ImageIO11CanReadFileEPKc+0x110)[0x7fc1747a4ba0]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(_ZN3itk14ImageIOFactory13CreateImageIOEPKcNS0_12FileModeTypeE+0x25c)[0x7fc174f4765c]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(+0x3865515)[0x7fc16eefe515]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(+0x370c569)[0x7fc16eda5569]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(+0x370cc28)[0x7fc16eda5c28]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(+0x335c038)[0x7fc16e9f5038]
/root/oli/rfl/env/lib/python3.5/site-packages/SimpleITK/_SimpleITK.so(+0x335cf35)[0x7fc16e9f5f35]
/usr/lib/libpython3.5m.so.1.0(PyCFunction_Call+0xc9)[0x7fc1f78f8bc9]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalFrameEx+0x799f)[0x7fc1f796fa3f]
/usr/lib/libpython3.5m.so.1.0(+0x1285e3)[0x7fc1f79715e3]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalFrameEx+0x5d8e)[0x7fc1f796de2e]
/usr/lib/libpython3.5m.so.1.0(+0x1285e3)[0x7fc1f79715e3]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalCodeEx+0x23)[0x7fc1f79716c3]
/usr/lib/libpython3.5m.so.1.0(+0x92fd8)[0x7fc1f78dbfd8]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(+0x7ed14)[0x7fc1f78c7d14]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(+0x185ee2)[0x7fc1f79ceee2]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(+0x119a1e)[0x7fc1f7962a1e]
/usr/lib/libpython3.5m.so.1.0(+0x95946)[0x7fc1f78de946]
/usr/lib/libpython3.5m.so.1.0(+0x95c00)[0x7fc1f78dec00]
/usr/lib/libpython3.5m.so.1.0(+0xc3475)[0x7fc1f790c475]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalFrameEx+0x3d6b)[0x7fc1f796be0b]
/usr/lib/libpython3.5m.so.1.0(+0x1285e3)[0x7fc1f79715e3]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalCodeEx+0x23)[0x7fc1f79716c3]
/usr/lib/libpython3.5m.so.1.0(+0x930c5)[0x7fc1f78dc0c5]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalFrameEx+0xee6)[0x7fc1f7968f86]
/usr/lib/libpython3.5m.so.1.0(+0x1285e3)[0x7fc1f79715e3]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalCodeEx+0x23)[0x7fc1f79716c3]
/usr/lib/libpython3.5m.so.1.0(+0x930c5)[0x7fc1f78dc0c5]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalFrameEx+0xee6)[0x7fc1f7968f86]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalFrameEx+0x88ca)[0x7fc1f797096a]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalFrameEx+0x88ca)[0x7fc1f797096a]
/usr/lib/libpython3.5m.so.1.0(+0x1285e3)[0x7fc1f79715e3]
/usr/lib/libpython3.5m.so.1.0(PyEval_EvalCodeEx+0x23)[0x7fc1f79716c3]
/usr/lib/libpython3.5m.so.1.0(+0x92fd8)[0x7fc1f78dbfd8]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(+0x7ed14)[0x7fc1f78c7d14]
/usr/lib/libpython3.5m.so.1.0(PyObject_Call+0x47)[0x7fc1f78b12b7]
/usr/lib/libpython3.5m.so.1.0(PyEval_CallObjectWithKeywords+0x47)[0x7fc1f7967da7]
/usr/lib/libpython3.5m.so.1.0(+0x1629a2)[0x7fc1f79ab9a2]
/usr/lib/libpthread.so.0(+0x7454)[0x7fc1f7633454]
/usr/lib/libc.so.6(clone+0x5f)[0x7fc1f73767df]

sitk::Show with color image produces error

With ImageJ 1.46r on Redhat 7 linux I am seeing the following error when trying to show an RGB image:

In [10]: sitk.Show(sitk.LabelToRGB(sitk.SLIC(img, 20)), debugOn=True)
FindApplication search path: [ /opt/Fiji.app, /usr/local/Fiji.app ]
Result:
FindApplication search path: [ /opt/Fiji.app, /usr/local/Fiji.app ]
Result:
FindApplication search path: [ /opt/ImageJ, /usr/local/ImageJ ]
Result: /opt/ImageJ/imagej
Show command: '/opt/ImageJ/imagej' '-e' 'open("/tmp/TempFile-8140-3.nii"); rename("/tmp/TempFile-8140-3.nii"); ' '-e' 'run("Make Composite", "display=Composite");'

In [11]:
Image display and analysis program. Opens formats including:
UNC, Analyze, Dicom, NIFTI, Tiff, Jpeg, Gif, PNG ...

imagej [options] image [ image2 ... image3 ] -> open images

basic options:
-h print help and more options
-o open images in existing ImageJ panel if one exists
-p open images in existing ImageJ panel number
-x set available memory (default=16000 max=515800)

advanced options:
-c enable plugin compilation within imagej
-d use development version
-v be verbose (vv or vvv increases verbosity)

options for batch processing:
-e 'Macro Code' execute macro code
-r 'Menu Command' run menu command
Quotation marks '' are required around commands including spaces
Commands can be sent to open ImageJ panels with the -p option

options for macros:
imagej [-i image] [-b|-m] [arg1 ... argN]
-b macro run macro without graphics window
-m macro run macro
"image" will be opened before macro is run
all following arguments are passed to macro

Documentation - http://rsb.info.nih.gov/ij/
Report problems with this software to

Only one command option (-b -e -m OR -r) may be specified

Having the macro over 2 arguments appears to be the problem. If the command is change to just one "-e" then it works:

os.environ["SITK_SHOW_COLOR_COMMAND"] = "%a -e ' open("%f"); rename("%t"); run("Make Composite", "display=Composite");'"

AddTransform requires an explicit cast to sitk.Transform

Here is an illustration of the problem in ipython:

In [1]: import SimpleITK as sitk
In [2]: a = sitk.Euler3DTransform()
In [3]: b = sitk.Euler3DTransform() # or any other transform
In [4]: a.AddTransform(b)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-16-e01092ec07d0> in <module>()
----> 1 a.AddTransform(b)

[...]/envs/py35/lib/python3.5/site-packages/SimpleITK/SimpleITK.py in AddTransform(self, t)
   4882
   4883         """
-> 4884         return _SimpleITK.Transform_AddTransform(self, t)
   4885
   4886

RuntimeError: Exception thrown in SimpleITK Transform_AddTransform: /nfs/Users/blowekamp/anaconda/conda-bld/work/Code/Common/src/sitkEuler3DTransform.cxx:174:
sitk::ERROR: Transform is not of type Euler3DTransform!

Weird thing, if you run the last line again:

In [5]: a.AddTransform(b)
Out[5]: <SimpleITK.SimpleITK.Transform; proxy of <Swig Object of type 'itk::simple::Transform *' at 0x1033af900> >

A way to make things work with the current code is to write:

c = sitk.Transform(a).AddTransform(sitk.Transform(b))

A possible fix is to cast all transforms to sitk.Transform before adding them. The current code:

    def AddTransform(self, t):
        """
        AddTransform(Transform self, Transform t) -> Transform

        """
        return _SimpleITK.Transform_AddTransform(self, t)

could be replaced with:

    def AddTransform(self, t):
        """
        AddTransform(Transform self, Transform t) -> Transform

        """
        return _SimpleITK.Transform_AddTransform(Transform(self), Transform(t))

Although it is likely that the problem occurs with the other wrapping languages too and that a proper fix should take place in the C++ code.

Debian packaging

I checked out the latest stable release (0.10.0) and attempted a build on Debian Stretch, which eventually failed. The relevant parts of the build log are pasted below. Same problem happens with the current tip of master.

cmake .. -DBUILD_SHARED_LIBS=ON -DWRAP_PYTHON=OFF -DBUILD_TESTING=OFF
-- The C compiler identification is GNU 6.2.1
-- The CXX compiler identification is GNU 6.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building SimpleITK version "0.10.0-g5c8b3"
-- Performing Test CXX_HAS_stdcxx11
-- Performing Test CXX_HAS_stdcxx11 - Success
-- Checking if c++11 is required...
-- Checking if c++11 is required... NO
-- Performing Test CXX_HAS-Wall
-- Performing Test CXX_HAS-Wall - Success
-- Performing Test CXX_HAS-Wno-long-double
-- Performing Test CXX_HAS-Wno-long-double - Failed
-- Performing Test CXX_HAS-Wno-long-long
-- Performing Test CXX_HAS-Wno-long-long - Success
-- Performing Test CXX_HAS-Wno-unused-local-typedefs
-- Performing Test CXX_HAS-Wno-unused-local-typedefs - Success
-- Performing Test CXX_HAS-Wno-strict-overflow
-- Performing Test CXX_HAS-Wno-strict-overflow - Success
-- Performing Test CXX_HAS-Wextra
-- Performing Test CXX_HAS-Wextra - Success
-- Performing Test CXX_HAS-Wformat_2
-- Performing Test CXX_HAS-Wformat_2 - Success
-- Performing Test CXX_HAS-Wno-format-nonliteral
-- Performing Test CXX_HAS-Wno-format-nonliteral - Success
-- Performing Test CXX_HAS-Wunused
-- Performing Test CXX_HAS-Wunused - Success
-- Performing Test CXX_HAS-Wpointer-arith
-- Performing Test CXX_HAS-Wpointer-arith - Success
-- Performing Test CXX_HAS-Winvalid-pch
-- Performing Test CXX_HAS-Winvalid-pch - Success
-- Performing Test CXX_HAS-Wcast-align
-- Performing Test CXX_HAS-Wcast-align - Success
-- Performing Test CXX_HAS-Wdisabled-optimization
-- Performing Test CXX_HAS-Wdisabled-optimization - Success
-- Performing Test CXX_HAS-Woverloaded-virtual
-- Performing Test CXX_HAS-Woverloaded-virtual - Success
-- Performing Test CXX_HAS-Wshadow
-- Performing Test CXX_HAS-Wshadow - Success
-- Performing Test CXX_HAS-Wwrite-strings
-- Performing Test CXX_HAS-Wwrite-strings - Success
-- Performing Test CXX_HAS-Wstrict-null-sentinel
-- Performing Test CXX_HAS-Wstrict-null-sentinel - Success
-- Performing Test CXX_HAS-Wno-invalid-offsetof
-- Performing Test CXX_HAS-Wno-invalid-offsetof - Success
-- The imported target "vtkgdcm" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkgdcm.so.2.6.6"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "vtkgdcmsharpglue" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkgdcmsharpglue.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "vtkgdcmJava" references the file
   "/usr/lib/x86_64-linux-gnu/jni/libvtkgdcmJava.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "vtkgdcmPython" references the file
   "/usr/lib/python/dist-packages/libvtkgdcmPython.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "vtkgdcmPythonD" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkgdcmPythonD.so.2.6.6"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmdump" references the file
   "/usr/bin/gdcmdump"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmdiff" references the file
   "/usr/bin/gdcmdiff"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmraw" references the file
   "/usr/bin/gdcmraw"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmscanner" references the file
   "/usr/bin/gdcmscanner"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmanon" references the file
   "/usr/bin/gdcmanon"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmgendir" references the file
   "/usr/bin/gdcmgendir"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmimg" references the file
   "/usr/bin/gdcmimg"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmconv" references the file
   "/usr/bin/gdcmconv"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmtar" references the file
   "/usr/bin/gdcmtar"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcminfo" references the file
   "/usr/bin/gdcminfo"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmscu" references the file
   "/usr/bin/gdcmscu"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmxml" references the file
   "/usr/bin/gdcmxml"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmpap3" references the file
   "/usr/bin/gdcmpap3"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- The imported target "gdcmpdf" references the file
   "/usr/bin/gdcmpdf"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/x86_64-linux-gnu/gdcm-2.6/GDCMTargets.cmake"
but not all the files it references.

-- Performing Test SITK_HAS_CXX11_STATIC_ASSERT
-- Performing Test SITK_HAS_CXX11_STATIC_ASSERT - Success
-- Performing Test SITK_HAS_CXX11_FUNCTIONAL
-- Performing Test SITK_HAS_CXX11_FUNCTIONAL - Success
-- Performing Test SITK_HAS_CXX11_TYPE_TRAITS
-- Performing Test SITK_HAS_CXX11_TYPE_TRAITS - Success
-- Performing Test SITK_HAS_CXX11_UNORDERED_MAP
-- Performing Test SITK_HAS_CXX11_UNORDERED_MAP - Success
-- Performing Test SITK_HAS_CXX11_NULLPTR
-- Performing Test SITK_HAS_CXX11_NULLPTR - Success
-- Performing Test SITK_HAS_CXX11_UNIQUE_PTR
-- Performing Test SITK_HAS_CXX11_UNIQUE_PTR - Success
-- Performing Test SITK_HAS_CXX11_ALIAS_TEMPLATE
-- Performing Test SITK_HAS_CXX11_ALIAS_TEMPLATE - Success
-- Performing Test SITK_HAS_TR1_SUB_INCLUDE
-- Performing Test SITK_HAS_TR1_SUB_INCLUDE - Success
-- Performing Test SITK_HAS_TR1_FUNCTIONAL
-- Performing Test SITK_HAS_TR1_FUNCTIONAL - Success
-- Performing Test SITK_HAS_TR1_TYPE_TRAITS
-- Performing Test SITK_HAS_TR1_TYPE_TRAITS - Success
-- Performing Test SITK_HAS_TR1_UNORDERED_MAP
-- Performing Test SITK_HAS_TR1_UNORDERED_MAP - Success
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
doc_path: /usr/share/doc/ITK-4.10
CMake Warning at CMakeLists.txt:305 (message):
  Unable to file ITK's NOTICE File!

   This file will not be included in SimpleITK packaging!


-- Performing Test SITK_UNDEFINED_SYMBOLS_ALLOWED - Success
-- Found Tclsh: /usr/bin/tclsh (found version "8.6") 
-- Found Lua: /usr/bin/lua  
-- Processing json files...
-- Processing json files...done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/SimpleITK/build
make

[ 78%] Building CXX object Code/BasicFilters/src/CMakeFiles/SimpleITKBasicFilters6.dir/sitkHistogramMatchingImageFilter.cxx.o
In file included from /usr/include/ITK-4.10/itkHistogramMatchingImageFilter.h:22:0,
                 from /tmp/SimpleITK/build/Code/BasicFilters/src/sitkHistogramMatchingImageFilter.cxx:34:
/usr/include/ITK-4.10/itkHistogram.h: In instantiation of ‘class itk::Statistics::Histogram<long int, itk::Statistics::DenseFrequencyContainer2>’:
/usr/include/ITK-4.10/itkHistogramMatchingImageFilter.h:106:58:   required from ‘class itk::HistogramMatchingImageFilter<itk::Image<long int, 3u>, itk::Image<long int, 3u>, long int>’
/tmp/SimpleITK/build/Code/BasicFilters/src/sitkHistogramMatchingImageFilter.cxx:151:32:   required from ‘itk::simple::Image itk::simple::HistogramMatchingImageFilter::ExecuteInternal(const itk::simple::Image&, const itk::simple::Image&) [with TImageType = itk::Image<long int, 3u>]’
/tmp/SimpleITK/Code/Common/include/sitkDetail.h:39:36:   required from ‘TMemberFunctionPointer itk::simple::detail::MemberFunctionAddressor<TMemberFunctionPointer>::operator()() const [with TImageType = itk::Image<long int, 3u>; TMemberFunctionPointer = itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)]’
/tmp/SimpleITK/Code/Common/include/sitkMemberFunctionFactory.hxx:59:7:   required from ‘typename itk::simple::EnableIf<itk::simple::IsInstantiated<TPixelIDType, VImageDimension>::Value>::Type itk::simple::detail::MemberFunctionInstantiater<TMemberFunctionFactory, VImageDimension, TAddressor>::operator()(TPixelIDType*) const [with TPixelIDType = itk::simple::BasicPixelID<long int>; TMemberFunctionFactory = itk::simple::detail::MemberFunctionFactory<itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)>; unsigned int VImageDimension = 3u; TAddressor = itk::simple::detail::MemberFunctionAddressor<itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)>; typename itk::simple::EnableIf<itk::simple::IsInstantiated<TPixelIDType, VImageDimension>::Value>::Type = void]’
/tmp/SimpleITK/Code/Common/include/Ancillary/TypeList.h:337:5:   recursively required from ‘void typelist::Visit<TTypeList>::operator()(const Predicate&) [with Predicate = itk::simple::detail::MemberFunctionInstantiater<itk::simple::detail::MemberFunctionFactory<itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)>, 3u, itk::simple::detail::MemberFunctionAddressor<itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)> >; TTypeList = typelist::TypeList<itk::simple::BasicPixelID<unsigned char>, typelist::TypeList<itk::simple::BasicPixelID<short int>, typelist::TypeList<itk::simple::BasicPixelID<short unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<int>, typelist::TypeList<itk::simple::BasicPixelID<unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<long int>, typelist::TypeList<itk::simple::BasicPixelID<long unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<float>, typelist::TypeList<itk::simple::BasicPixelID<double>, typelist::NullType> > > > > > > > >]’
/tmp/SimpleITK/Code/Common/include/Ancillary/TypeList.h:337:5:   required from ‘void typelist::Visit<TTypeList>::operator()(const Predicate&) [with Predicate = itk::simple::detail::MemberFunctionInstantiater<itk::simple::detail::MemberFunctionFactory<itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)>, 3u, itk::simple::detail::MemberFunctionAddressor<itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)> >; TTypeList = typelist::TypeList<itk::simple::BasicPixelID<signed char>, typelist::TypeList<itk::simple::BasicPixelID<unsigned char>, typelist::TypeList<itk::simple::BasicPixelID<short int>, typelist::TypeList<itk::simple::BasicPixelID<short unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<int>, typelist::TypeList<itk::simple::BasicPixelID<unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<long int>, typelist::TypeList<itk::simple::BasicPixelID<long unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<float>, typelist::TypeList<itk::simple::BasicPixelID<double>, typelist::NullType> > > > > > > > > >]’
/tmp/SimpleITK/Code/Common/include/sitkMemberFunctionFactory.hxx:127:16:   required from ‘void itk::simple::detail::MemberFunctionFactory<TMemberFunctionPointer>::RegisterMemberFunctions() [with TPixelIDTypeList = typelist::TypeList<itk::simple::BasicPixelID<signed char>, typelist::TypeList<itk::simple::BasicPixelID<unsigned char>, typelist::TypeList<itk::simple::BasicPixelID<short int>, typelist::TypeList<itk::simple::BasicPixelID<short unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<int>, typelist::TypeList<itk::simple::BasicPixelID<unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<long int>, typelist::TypeList<itk::simple::BasicPixelID<long unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<float>, typelist::TypeList<itk::simple::BasicPixelID<double>, typelist::NullType> > > > > > > > > >; unsigned int VImageDimension = 3u; TAddressor = itk::simple::detail::MemberFunctionAddressor<itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)>; TMemberFunctionPointer = itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)]’
/tmp/SimpleITK/Code/Common/include/sitkMemberFunctionFactory.h:123:5:   required from ‘void itk::simple::detail::MemberFunctionFactory<TMemberFunctionPointer>::RegisterMemberFunctions() [with TPixelIDTypeList = typelist::TypeList<itk::simple::BasicPixelID<signed char>, typelist::TypeList<itk::simple::BasicPixelID<unsigned char>, typelist::TypeList<itk::simple::BasicPixelID<short int>, typelist::TypeList<itk::simple::BasicPixelID<short unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<int>, typelist::TypeList<itk::simple::BasicPixelID<unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<long int>, typelist::TypeList<itk::simple::BasicPixelID<long unsigned int>, typelist::TypeList<itk::simple::BasicPixelID<float>, typelist::TypeList<itk::simple::BasicPixelID<double>, typelist::NullType> > > > > > > > > >; unsigned int VImageDimension = 3u; TMemberFunctionPointer = itk::simple::Image (itk::simple::HistogramMatchingImageFilter::*)(const itk::simple::Image&, const itk::simple::Image&)]’
/tmp/SimpleITK/build/Code/BasicFilters/src/sitkHistogramMatchingImageFilter.cxx:55:73:   required from here
/usr/include/ITK-4.10/itkHistogram.h:285:8: error: ‘bool itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::IncreaseFrequency(const MeasurementVectorType&, itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType) [with TMeasurement = long int; TFrequencyContainer = itk::Statistics::DenseFrequencyContainer2; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::MeasurementVectorType = itk::Array<long int>; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType = long unsigned int]’ cannot be overloaded
   bool IncreaseFrequency(
        ^~~~~~~~~~~~~~~~~
/usr/include/ITK-4.10/itkHistogram.h:279:8: error: with ‘bool itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::IncreaseFrequency(const IndexType&, itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType) [with TMeasurement = long int; TFrequencyContainer = itk::Statistics::DenseFrequencyContainer2; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::IndexType = itk::Array<long int>; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType = long unsigned int]’
   bool IncreaseFrequency(const IndexType & index,
        ^~~~~~~~~~~~~~~~~
Code/BasicFilters/src/CMakeFiles/SimpleITKBasicFilters6.dir/build.make:542: recipe for target 'Code/BasicFilters/src/CMakeFiles/SimpleITKBasicFilters6.dir/sitkHistogramMatchingImageFilter.cxx.o' failed
make[2]: *** [Code/BasicFilters/src/CMakeFiles/SimpleITKBasicFilters6.dir/sitkHistogramMatchingImageFilter.cxx.o] Error 1
CMakeFiles/Makefile2:619: recipe for target 'Code/BasicFilters/src/CMakeFiles/SimpleITKBasicFilters6.dir/all' failed
make[1]: *** [Code/BasicFilters/src/CMakeFiles/SimpleITKBasicFilters6.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

SimpleITK Compile Issue while Performing Build Step for PCRE

I'm building SimpleITK on MacOSX 10.11.5 from github using the following code

cd ~
git clone https://github.com/SimpleITK/SimpleITK
cd SimpleITK
mkdir build
cd build
cmake ../SuperBuild

I get the following error, which has been reported previously (#33)

[ 19%] Performing build step for 'GTest'
Scanning dependencies of target gtest
[ 25%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 50%] Linking CXX static library lib/libgtest.a
[ 50%] Built target gtest
Scanning dependencies of target gtest_main
[ 75%] Building CXX object CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[100%] Linking CXX static library lib/libgtest_main.a
[100%] Built target gtest_main
[ 20%] Performing install step for 'GTest'
[ 21%] Completed 'GTest'
[ 21%] Built target GTest
Scanning dependencies of target PCRE
[ 23%] Performing build step for 'PCRE'
make[3]: *** No targets specified and no makefile found. Stop.
make[2]: *** [PCRE-prefix/src/PCRE-stamp/PCRE-build] Error 2
make[1]: *** [CMakeFiles/PCRE.dir/all] Error 2
make: *** [all] Error 2

Despite running the suggested workaround:

cmake -DCMAKE_CXX_COMPILER:STRING=/usr/bin/clang++ -DCMAKE_C_COMPILER:STRING=/usr/bin/clang ../SuperBuild

I still get the same error when running
sudo make

[ 10%] Built target ITK
[ 21%] Built target Lua
[ 32%] Built target GTest
[ 34%] Performing build step for 'PCRE'
make[3]: *** No targets specified and no makefile found. Stop.
make[2]: *** [PCRE-prefix/src/PCRE-stamp/PCRE-build] Error 2
make[1]: *** [CMakeFiles/PCRE.dir/all] Error 2
make: *** [all] Error 2

Any suggestions for fixing this issue?

Thanks in advance

Doxygen build does not respect FORBID_DOWNLOADS

As mentioned in #92, the documentation target still tries to download the ITK tags even when FORBID_DOWNLOADS is specified.

Should the ITK_DOXYGEN_TAG_LOCATION be required, if there downloads are forbidden?

Exporting to numpy changes the order of dimensions

Hi,
Maybe this is not an issue, but I am not aware of this behaviour, so I'm just asking why it happens like this :

import SimpleITK as sitk
import numpy as np

img = sitk.ReadImage('random nifti image')
img.GetPixel(12, 13, 14) # print 0
img.SetPixel(12, 13, 14, 666)
sitk.WriteImage(img, 'my nifti file')

img = sitk.ReadImage('same nifti image')
img.GetPixel(12, 13, 14) # print 666
sitk.GetArrayFromImage(img)[12, 13, 14] # returns 0

# looking for the index of value 666
np.where(sitk.GetArrayFromImage(img) == 666)
#returns (array([14]), array([13]), array([12]))

# I conclude that during exporting to numpy, the 1st and 3rd dimensions are swapped

There is all details about the image :

Pixel Type is scalar
Component Type is short
Image Dimension is 3
Image (0x1be8570)
  RTTI typeinfo:   itk::Image<short, 3u>
  Reference Count: 2
  Modified Time: 339
  Debug: Off
  Object Name: 
  Observers: 
    none
  Source: (none)
  Source output name: (none)
  Release Data: Off
  Data Released: False
  Global Release Data: Off
  PipelineMTime: 0
  UpdateMTime: 0
  RealTimeStamp: 0 seconds 
  LargestPossibleRegion: 
    Dimension: 3
    Index: [0, 0, 0]
    Size: [182, 218, 182]
  BufferedRegion: 
    Dimension: 3
    Index: [0, 0, 0]
    Size: [182, 218, 182]
  RequestedRegion: 
    Dimension: 3
    Index: [0, 0, 0]
    Size: [182, 218, 182]
  Spacing: [1, 1, 1]
  Origin: [-90, 126, -72]
  Direction: 
1 0 0
0 -1 0
0 0 1

  IndexToPointMatrix: 
1 0 0
0 -1 0
0 0 1

  PointToIndexMatrix: 
1 0 0
0 -1 0
0 0 1

  Inverse Direction: 
1 0 0
0 -1 0
0 0 1

  PixelContainer: 
    ImportImageContainer (0x1be9240)
      RTTI typeinfo:   itk::ImportImageContainer<unsigned long, short>
      Reference Count: 1
      Modified Time: 331
      Debug: Off
      Object Name: 
      Observers: 
        none
      Pointer: 0x7fc105d7c010
      Container manages memory: true
      Size: 7221032
      Capacity: 7221032

Thanks !

How to use sitk's Lua bindings from other interpreters?

Hi,
Thanks for the effort put into this library. It's awesome. Sitk having lua bindings is particularly interesting for torch users like me because the native image library in torch is not very powerful and we tend to do most of our preprocessing in python.
Is there a lua module which is part of the build that I can use from trepl or other interpreters?

Regards,
Preetham.

DICOM information when reading series

When reading a series of dicom images, the dicom header information is not retrieved as well. If only one of those dicom images is read, the dicom information is present as it should be.

reader = sitk.ImageSeriesReader()
series_ids = reader.GetGDCMSeriesIDs(dicom_path)
dicom_names = reader.GetGDCMSeriesFileNames(dicom_path, series_ids[0])

reader.SetFileNames(dicom_names)
img1 = reader.Execute()
img2 = sitk.ReadImage(dicom_names[0])

print(img1.GetMetaDataKeys()) #  ()
print(img2.GetMetaDataKeys()) #  ('0008|0005', '0008|0008', '0008|0012', '0008|0013', '0008|0016', ...)

I used this data set to test: https://bitbucket.org/somada141/pyscience/raw/master/20141001_SegmentationSimpleITK/Material/MyHead.zip

support for point sets

Add support for point-sets in the registration framework:

  1. In the ImageRegistrationMethod class, allow the user to provide a point-set as the samples for intensity based registration (currently a workaround to doing this is to create a mask based on the point set).

  2. Support point-set to point-set registration.

  3. Support point-set (surface) to image registration.

  4. Support point-set Read/Write.

Python wrapper does not load in UBuntu-Mate for Raspberry Pi3

I am building SITK on a Raspberry Pi3 with UBuntu-Mat 16.04. I am using clang3.8 as the compiler. The library only builds under the following conditions:
a.) Shared module library is enabled
If I disable this, then when I build the Python wrapper it gives me a linker error. So, I presume there is some linker error here.

When I build it with shared library mode enabled, the build and installation happens successflly. When I try to load the module in Python 3.5 (default version in UBuntu Mate), I get the following error:

Type "help", "copyright", "credits" or "license" for more information.

import SimpleITK
Traceback (most recent call last):
File "", line 1, in
File "/home/Downloads/bin/SimpleITK/lib/SimpleITK.py", line 28, in
_SimpleITK = swig_import_helper()
File "/home/naths/Downloads/bin/SimpleITK/lib/SimpleITK.py", line 24, in swig_import_helper
_mod = imp.load_module('_SimpleITK', fp, pathname, description)
File "/usr/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libSimpleITKBasicFilters13-0.10.so.1: cannot open shared object file: No such file or directory

What could I be doing wrong here?

Python pip wheel for Mac

Hi,

From wiki ,

The pip package manager should automatically find the correct package for MS Windows and GNU Linux if your version is supported. For Apple OS X you need to manually specify:
pip install https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0/Python/SimpleITK-0.10.0-cp27-cp27m-macosx_10_6_intel.whl

However this will work only for python 2.7. I get the following error if used with python 3.5:

$ pip install https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0/Python/SimpleITK-0.10.0-cp27-cp27m-macosx_10_6_intel.whl
SimpleITK-0.10.0-cp27-cp27m-macosx_10_6_intel.whl is not a supported wheel on this platform.

Why are the wheels for mac not uploaded to pypi? Uploading them should enhance the UX.

Thanks,
Sasank.

dev version problem - Anaconda distribution

Release version on Ubuntu 14.04 works fine. However importing SimpleITK in dev version throws the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-3dd12c25dd88> in <module>()
----> 1 import SimpleITK as sitk

/home/m/anaconda2/lib/python2.7/site-packages/SimpleITK/__init__.py in <module>()
----> 1 from .SimpleITK import *

/home/m/anaconda2/lib/python2.7/site-packages/SimpleITK/SimpleITK.py in <module>()
     26                 fp.close()
     27             return _mod
---> 28     _SimpleITK = swig_import_helper()
     29     del swig_import_helper
     30 else:

/home/m/anaconda2/lib/python2.7/site-packages/SimpleITK/SimpleITK.py in swig_import_helper()
     22         if fp is not None:
     23             try:
---> 24                 _mod = imp.load_module('_SimpleITK', fp, pathname, description)
     25             finally:
     26                 fp.close()

ImportError: libpng15.so.15: cannot open shared object file: No such file or directory
```f

Compilation problem for PCRE on Mac OSX Yosimite

Thank-you for making ITK accessible to higher-level programming languages via SimpleITK. I have been using the it via python 2.7 for over a month now and it is excellent. I am running on a macbook pro and using the SuperBuild process outlined in the documentation. While I can get this to build (no problem) on my Ubuntu 14.04 laptop, it fails quite early on the mac. I cloned from the 0.9.0 tag via github. Here are the details...

brandon$ uname -a
Darwin Brandons-MacBook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

...

[ 19%] Built target ITK
[ 21%] Creating directories for 'PCRE'
[ 24%] Performing download step (download, verify and extract) for 'PCRE'
-- verifying file...
file='/Users/brandon/Downloads/SimpleITK-0.9.0/SimpleITK-build/PCRE-prefix/src/method=midas.bitstream.download&checksum=ff7b4bb14e355f04885cf18ff4125c98&name=pcre-8.36.tar.gz'
-- verifying file... done
-- extracting...
src='/Users/brandon/Downloads/SimpleITK-0.9.0/SimpleITK-build/PCRE-prefix/src/method=midas.bitstream.download&checksum=ff7b4bb14e355f04885cf18ff4125c98&name=pcre-8.36.tar.gz'
dst='/Users/brandon/Downloads/SimpleITK-0.9.0/SimpleITK-build/PCRE-prefix/src/PCRE'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 26%] No patch step for 'PCRE'
[ 29%] No update step for 'PCRE'
[ 31%] Performing configure step for 'PCRE'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /Users/brandon/Downloads/SimpleITK-0.9.0/SimpleITK-build/PCRE-prefix/src/PCRE/install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in /Users/brandon/Downloads/SimpleITK-0.9.0/SimpleITK-build/PCRE-prefix/src/PCRE-build': configure: error: cannot run C compiled programs. If you meant to cross compile, use--host'.
See `config.log' for more details
[ 34%] Performing build step for 'PCRE'
make[3]: *** No targets specified and no makefile found. Stop.
make[2]: *** [PCRE-prefix/src/PCRE-stamp/PCRE-build] Error 2
make[1]: *** [CMakeFiles/PCRE.dir/all] Error 2
make: *** [all] Error 2

Any advice would be extremely welcome! I wouldn't mind using homebrew, but it appears to be stuck on version 0.8.0 and I'm keen to try out the registration methods.

Cheers, Brandon

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.