Coder Social home page Coder Social logo

brainweb's Introduction

brainweb's People

Contributors

casperdcl avatar kristhielemans 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

Watchers

 avatar

brainweb's Issues

brainweb "index" values do not match

the imported label image has different values than expected, leading to aroundFat, dura and marrow being empty

>>> import sirf.STIR
>>> im=sirf.STIR.ImageData('brainweb_labels.nii')
>>> arr=im.as_array()
>>> numpy.unique(arr)
array([  0.,  16.,  32.,  48.,  64.,  80.,  96., 112., 128., 145., 161., 177.], dtype=float32)
>>> import brainweb
>>> brainweb.Act.aroundFat
144
>>> brainweb.Act.dura
160
>>> brainweb.Act.marrow
176

It seems safer to use the 8bit valued images, in which case we wouldn't have this problem

allow specifying different resolution

toPetMmR has an an outres parameter

brainweb/brainweb/utils.py

Lines 398 to 399 in 202eb40

def toPetMmr(im, pad=True, dtype=np.float32, outres="mMR", modes=None,
PetClass=FDG):

It would be nice to be able to pass this to the higher level get_mmr and get_mmr_fromfile as well, such that we can get images at different voxel-size out.

It would be even better to be able to specify arbitrary voxel-size/shape, but that seems to only be possible by modifying the Res/Shape classes, which seems to require major surgery, or possibly doing a setattr(Res, mMR, ...) and same for Shape

Issues with resolution other than mMR

G'day Casper,

Loving this tool, thanks.

There are a few issues with using resolutions other than mMR.

The Shape class should cast its calculations to type np.int (and floor?)
Otherwise I run into type issues here: https://github.com/casperdcl/brainweb/blob/master/brainweb/utils.py#L301

Somewhat related but not really: the noise() function assumes sigma is given in voxel units - is this preferred? Potentially confusing for the user, we had to change sigma with resolution.

get_mMR_from_file ignore parameters?

I believe these are wrong

brainweb/brainweb/utils.py

Lines 259 to 260 in 202eb40

petNoise=1.0, t1Noise=0.75, t2Noise=0.75,
petSigma=1.0, t1Sigma=1.0, t2Sigma=1.0,

as they overwrite any arguments specified to the function, but should be

petNoise=petNoise, t1Noise=t1Noise, t2Noise=t2Noise, 
 petSigma=petSigma, t1Sigma=t1Sigma, t2Sigma=t2Sigma, 

Problem with PET image plot in brainweb

Hi Casper,

When I'm trying to run brainweb, as PET output I am getting a blank plot.

Please see the screenshot as attached.

Could you please assist to fix it. I tried running the code many times.

Screenshot_20200219-194043_Gallery

`volshow` broken in `matplotlib>=3.3.2`

using matplotlib==3.3.2, the brainweb.volshow slider doesn't work. Changing the slider value doesn't change slices, but instead creates a new blank figure.

Everything works as expected in matplotlib==3.3.1.

extract labelfields

is there an easy way to extract labelfields for the different VOIs (white matter, grey matter, skin, etc.)? End goal is to create a 4D .nii with a 3D image per VOI. Background would also be nice. The values can be binary or probabilistic, we don't mind (as long as sum =1).

Our initial thought was to use petNoise=0, petSigma=0 and then do value-based labelfields, but I'm not sure what happens when you have a mixture of two VOIs in the same voxel.

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.