question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why can't I segment my T1w data?

See original GitHub issue
import ants
import numpy as np
in_brain = '/Users/derekpisner/Downloads/tuning_derivatives/BIDS/sub-25637/ses-1/anat/

sub-25637_desc-preproc_T1w.nii.gz'

img = ants.image_read(in_brain)
mask = ants.get_mask(img)

In [30]: img                                                                                                                     
Out[30]: 
ANTsImage (LPI)
	 Pixel Type : float (float32)
	 Components : 1
	 Dimensions : (12948672768602079266, 140735019887547, 0)
	 Spacing    : (0.0, 28.3333, 0.0)
	 Origin     : (71.2519, 130.012, -114.7487)
	 Direction  : [-1.  0.  0.  0. -1.  0.  0.  0.  1.]

In [30]: img_seg = ants.atropos(a=img, i='kmeans[3]', x=mask)
AttributeError                            Traceback (most recent call last)
<ipython-input-28-8990f5c3164a> in <module>
     10         'x': mymask
     11     }
---> 12     for k, v in kwargs.items():
     13         myargs[k] = v
     14 
AttributeError: 'NoneType' object has no attribute 'items'

Is this because it’s 3d?

Here’s the file: https://drive.google.com/file/d/1OuDofzvWa8ZtSnB0xseO0EezTWhwgsul/view?usp=sharing @dPys

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ntustisoncommented, Jul 24, 2020

It’s probably because you have a spacing of 0 in two of three dimensions.

0reactions
dPyscommented, Jul 24, 2020

@stnava – that worked. Thanks to both of you! Will close now and if I experience any further issues, I’ll reopen a new issue.

@dPys ;

Read more comments on GitHub >

github_iconTop Results From Across the Web

About segments - Analytics Help - Google Support
A segment is a subset of your Analytics data. For example, of your entire set of users, one segment might be users from...
Read more >
Segmentation Troubleshooting | Adobe Analytics
Why can't I see the segment I created in the Segment Manager? Possible reasons: Some dimensions are available only in Data Warehouse and...
Read more >
Image Processing Tips and Tricks - Neuroimaging Core
T1w images can be processed with a single script described in Prepare T1w Image that reorients, bias-corrects, crops and even generates a brain...
Read more >
Filtering your Segment Data
There are many ways you can use Segment to filter event and object based data to control which destinations it reaches.
Read more >
Processing pipeline details — fmriprep version documentation
In the case of brain-extracted (skull-stripped) T1w images, attempting to perform brain extraction again will often have poor results and may cause fMRIPrep...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found