nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
145 stars 54 forks source link

Zernike KeyError #44

Closed binarybottle closed 10 years ago

binarybottle commented 10 years ago

Brian -- I don't remember this happening before, but most of the zernike_moments_per_label() calls are failing for labeled regions, and some are failing for sulcus regions. For example, when I try to run the function on the following vtk file, I get a "KeyError":

>>> vtk_file = '/home/arno/mindboggle_working/OASIS-TRT-20-3/Mindboggle/Surface_features/_hemi_lh/Sulci/sulci.vtk'

>>> zernike_moments_per_label(vtk_file, order=3, exclude_labels=[-1,0], scale_input=True, decimate_fraction=0, decimate_smooth=25)

Load "sulci" scalars from sulci.vtk
  5504 vertices for label 1
Reduced 131011 to 10516 triangular faces
Trinomial
D_CV_orig
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-7-869574256d1a> in <module>()
     40                                           order, scale_input,
     41                                           decimate_fraction,
---> 42                                           decimate_smooth)
     43 
     44             #-------------------------------------------------------------

/home/arno/anaconda/lib/python2.7/site-packages/mindboggle/shapes/zernike/zernike.pyc in zernike_moments(points,decimate_fraction, decimate_smooth)
    210     # Geometric moments:
    211     #-------------------------------------------------------------------------
--> 212     G = pl.geometric_moments_orig(points, faces, order, n_faces, n_V)
    213 
    214     #

/home/arno/anaconda/lib/python2.7/site-packages/mindboggle/shapes/zernike/multiproc/geometric_moments_orig_m.pycfacets, num_vertices)
     97 
     98     for facet in cfg.rng(1,num_facets) :
---> 99         C1[facet-1,:,:,:] = C_temp_lookup[facet][0,:,:,:] #!                                #    C1(face
    100         Vol[facet-1,0] = Vol_temp_lookup[facet] #!                                          #    Vol(fac
    101         #if cfg.mod(facet,1000) == 0 :                                         #    if mod(facet,1000) =

KeyError: 10485
brianthelion commented 10 years ago

Ok, I'll take a look. Thanks!

brianthelion commented 10 years ago

@binarybottle Where can I get one of the failing VTK files? I can't identify where this one lives in the datasets on the website. Thanks!

brianthelion commented 10 years ago

Quick assessment: So with b8800fd2130a42835d1ed64c12925571dbae1f36 we tweaked some of the indexing of the faces. index1 is getting set here.

binarybottle commented 10 years ago

Oh -- I didn't realize that the 1-indexing was hard-coded in. I guess we don't need to call reindex_faces_0to1() and can set index1 to False. I'll make that change right now and re-run. Thanks for catching this, Brian!

brianthelion commented 10 years ago

Did that take care of it?

binarybottle commented 10 years ago

So far it is running fine on the Mindboggle-101 dataset. I'll tell you when they've all been processed...