Comments (9)
Hello @Ivanka07,
That is strange. The conversion to list should work with the versions you are using. On OSX, Python 3.8.5, SimpleITK 2.1.0 the following works, please try:
import SimpleITK as sitk
import numpy as np
rif = sitk.ResampleImageFilter()
rif.SetSize(np.array([1, 2, 3], dtype='int').tolist())
from simpleitk.
4 years later, I stumbled upon this issue myself. Is this going to get fixed?
from simpleitk.
@Grieverheart have you found a solution/workarround for this issue? I am using Python3.8 and SimpleITK 2.1.0 and above proposed solutions don't work for me...
from simpleitk.
using tolist() does not work for me in my case.
from simpleitk.
Thank you for reporting the issue.
@zivy Have you encountered this issue?
from simpleitk.
Confirmed the issue. I have never tried it with numpy arrays, as I either use tuple or list notation for these operations (these work in Python3).
@haarburger just out of curiosity, what was the motivation for using a numpy array for specifying size vs. the more concise list or tuple notation?
from simpleitk.
@zivy Using numpy arrays was not my decision. It was implemented like that in pyradiomics and as a pyradiomics user I stumbled upon this.
from simpleitk.
There looks like there is a related SWIG issue open: swig/swig#888
We will also look into finding a work around in SimpleITK too.
from simpleitk.
Hello @zhilothebest,
Please provide a minimal working example showing that the usage of tolist()
does not work. I tried resampling with a numpy array converted via the tolist
function and it does work for me.
Possibly specify the Python version and OS you are using.
from simpleitk.
Related Issues (20)
- fresh conda env with ImportError: nomodule named '_SimpleITK' on Windows 11 HOT 2
- SIEMENS .ima MagnetomVision files HOT 3
- Release wheels for SimpleITK with Elastix for Ubuntu HOT 1
- Compilation on M1 Error: HOT 1
- CMake hangs on M1 HOT 1
- Python Documentation bug in sitk.Image constructor HOT 4
- sitk::ERROR: Pixel type: 32-bit unsigned integer is not supported in 3D byN3itk6simple15MaskImageFilterE HOT 7
- Export `PixelIDValueEnum` members as members of Enum in Python binding
- missing numpy dependency in python wheels and conda package HOT 2
- Move detailed class description to the top of the doc page
- Install on IpadOS v16.6 HOT 2
- RuntimeError: Exception thrown in SimpleITK ImageFileReader_Execute: ../Code/IO/src/sitkImageReaderBase.cxx:97: sitk::ERROR: HOT 1
- Add ImageSeriesReader::SpacingWarningRelThreshold
- SimpleITK getting slower with intense working (JAVA) (memory leak?) HOT 11
- enable ImageFileReader.SetUseStreaming method for JAVA
- SetKernelRadius() does not handle numpy integer types HOT 1
- Extend sitk.ReadImage()/WriteImage() to support pathlib.Path() HOT 1
- add or change the interface for the ImageRegistraitonMethod.SetOptimizerAsAmoeba method HOT 1
- Error writing `SimpleITK Image` to DICOM files HOT 1
- GetBufferAsType functions missing (Python 3.12.1, SimpleITK 2.3.1) HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpleitk.