Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:15
    jni commented #4241
  • 11:13
    jni commented #4241
  • 10:10
    rathaROG edited #4241
  • 10:09
    rathaROG opened #4241
  • 09:14
    rfezzani commented #4178
  • 09:13
    pep8speaks commented #4178
  • 09:13
    rfezzani synchronize #4178
  • 08:47
    haesleinhuepf commented #4215
  • 08:39
    haesleinhuepf commented #4215
  • 07:49
    packoman edited #4240
  • 07:47
    packoman edited #4240
  • 07:45
    packoman edited #4240
  • 07:44
    packoman opened #4240
  • 03:40
    Travis stefanv/scikit-image (CoC) passed (648)
  • 03:22
    stefanv commented #4222
  • 02:43
    stefanv synchronize #4202
  • 02:02
    Travis stefanv/scikit-image (CoC) errored (647)
  • 01:55
    jni commented #4215
  • 01:52
    Travis stefanv/scikit-image (release-process-fixes/release-notes) fixed (646)
E | M
@ewuramaminka
@kmader thanks a lot!
Tanim Islam
@tanimislam
Hi all, can scikit-image save an M×NM \times N integer numpy array into a 16-bit grayscale image?
Juan Nunez-Iglesias
@jni
yep, if you do from skimage import io; io.imsave('filename.png', arr.astype(np.uint16)), it should work. I'm assuming of course that you don't have any integers larger than 65535
Tanim Islam
@tanimislam
thanks @jni
and yes, no integers larger than 65535 (numpy array represents 16-bit grayscale data)
Stefan van der Walt
@stefanv

Hi everyone; we're going to try something new for the chat forum. Please direct your browsers to:

https://skimage.zulipchat.com

(or download the app)

We'll try this forum for a few weeks to see how it goes!

Sreekar Reddy
@sreekar2307
Any non-intelligent algorithms for image classification?
E | M
@ewuramaminka
How do I load a nifty image ? I want to use threshold otsu to separate composition

I used nibabel to load it fine but it’s a 3D and I threshold it using threshold_otsu

The error I’m getting is “Nifti1Image’ object has no attribute min

Please assist
Curtis Rueden
@ctrueden
@ewuramaminka Are you able to post a link to a sample non-working NIFTI image?
E | M
@ewuramaminka
Sure
Curtis Rueden
@ctrueden
@ewuramaminka Is this image all zeroes?
Nevermind, I see that it is not.
@ewuramaminka I got it working by opening the image through ImageJ using pyimagej. :-)
Curtis Rueden
@ctrueden
I will post a gist shortly.
This gets you a numpy array from your NIFTI data, which is presumably what you want? Then you can analyze it with skimage (and/or ImageJ) as per usual.
Curtis Rueden
@ctrueden
@ewuramaminka I checked your code and saw you using SimpleITK. Is that working? If so, you could also stick with that.
You mention nibabel above… your error suggests to me the object you get back isn’t an numpy array, but a Nifti1Image object. There is probably a function you can call on it that will give you a numpy array? Sorry, I don’t know that library.
E | M
@ewuramaminka
@ctrueden i realised you plotted one slice ?
Curtis Rueden
@ctrueden
Yeah, there might be a bug with converting the whole 3D thing to numpy at once. As a workaround, it can be converted slice by slice.
But it sounds like you have other/better ways of getting the data into Python already. Particularly nibabel which looks pretty tailored to your needs?
It’s just a matter of getting the pixels as a numpy array, right?
E | M
@ewuramaminka
nibabel doesnt even let me create the histograms i want
my current need is to use threshold_otsu to threshold my nifty .. if u could please try that
using simple ITK
Curtis Rueden
@ctrueden

It looks like you need to write:

import nibabel as nib
img = nib.load(filename)
data = img.get_fdata()

and then type(data) will be numpy.ndarray instead of Nifti1Image. And you can compute stuff on the data. Does that help?

E | M
@ewuramaminka
ok i just tried
i still got this 'AttributeError: 'Nifti1Image' object has no attribute 'get_fdata'
Curtis Rueden
@ctrueden
Which version of nibabel?
We can check the source code.
From the changelog: it looks like the get_fdata was added in version 2.2? Are you using an older version? If so, try upgrading.
Gotta run to a meeting. Good luck.
E | M
@ewuramaminka
2.0.2
nibabel ver - 2.0.2
Curtis Rueden
@ctrueden
See if you can update to 2.2 or newer.
E | M
@ewuramaminka
I finally got stik to load it
Thanks very much
Dr .Muhammad Anjum Iqbal
@DrMuhammadAnju1_twitter
Hi i DO NOT KNOW , it is proper platform about my problem ! but if any body knows . please let me know . my question is "to get R in python for window "
Mark Harfouche
@hmaarrfk
Mixing languages is hard.

Hi everyone; we're going to try something new for the chat forum. Please direct your browsers to:

https://skimage.zulipchat.com

(or download the app)

We'll try this forum for a few weeks to see how it goes!

E | M
@ewuramaminka

I have dicom files to auto segment using atlas and CNN approach. I’m looking to measure correspondence between these automatic contours and manual contours created by experts. Kindly advise what techniques are best

-Hausdoff distance
-structural similarity index (SSIM)
-Bidirectional local distance measurement (BLD)
-Mean square errors (MSE)
-Dice similarity coefficient
-Distance transforms

Please advise if there are any I haven’t listed and which ones are best for the operation I want to carry out.

Vishesh Mangla
@XtremeGood
someone here?
E | M
@ewuramaminka
im wondering.. nobody replied to my question
Josh Moore
@joshmoore
Perhaps try on https://forum.image.sc ?
Kira Evans
@kne42
the scikit-image devs have switched to using zulip and no longer monitor this channel