neurodata / ndreg-old

NeuroData's registration library, built in python using ITK
Apache License 2.0
2 stars 2 forks source link

Runtime Error Mac OSX Python 2.7 Homebrew #33

Closed mlee156 closed 8 years ago

mlee156 commented 8 years ago

SYSTEM: Mac OSX PYTHON VERSION: Python 2.7 from homebrew

In the advanced registration tutorial, when running the following code on the new images

I get the following error:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-36-705d947f1842> in <module>()
      1 inImg_ds = imgResample(inImg, spacing=spacing)
----> 2 imgShow(inImg_ds, vmax=500)

/Users/albert/ndreg/ndreg/ndreg.pyc in imgShow(img, vmin, vmax, cmap, alpha, newFig, numSlices)
   1184                 sliceIndex = [0]*img.GetDimension()
   1185                 sliceIndex[2-i] = int(slice)
-> 1186                 sliceImg = sitk.Extract(img, sliceSize, sliceIndex)
   1187 
   1188                 plt.subplot(numSlices, img.GetDimension(),i+img.GetDimension()*j+1)

/usr/local/lib/python2.7/site-packages/SimpleITK/SimpleITK.pyc in Extract(*args, **kwargs)
  26378 
  26379     """
> 26380     return _SimpleITK.Extract(*args, **kwargs)
  26381 class FastApproximateRankImageFilter(ImageFilter_1):
  26382     """

RuntimeError: Exception thrown in SimpleITK Extract: /tmp/simpleitk20151126-61588-18lv2pz/SimpleITK-0.9.0/sitk-build/ITK/Modules/Core/Common/src/itkDataObject.cxx:393:
Requested region is (at least partially) outside the largest possible region.
mlee156 commented 8 years ago

Here are the context files: I'm opening this issue because it is different from the previous one that I specified.

screen shot 2016-09-26 at 9 16 05 pm screen shot 2016-09-26 at 9 16 22 pm

mlee156 commented 8 years ago

Your previous suggestion was to print inImg:

Image (0x7f94be73c930)
  RTTI typeinfo:   itk::Image<unsigned short, 3u>
  Reference Count: 1
  Modified Time: 5392
  Debug: Off
  Object Name: 
  Observers: 
    none
  Source: (none)
  Source output name: (none)
  Release Data: Off
  Data Released: False
  Global Release Data: Off
  PipelineMTime: 5382
  UpdateMTime: 5391
  RealTimeStamp: 0 seconds 
  LargestPossibleRegion: 
    Dimension: 3
    Index: [0, 0, 0]
    Size: [396, 92, 240]
  BufferedRegion: 
    Dimension: 3
    Index: [0, 0, 0]
    Size: [396, 92, 240]
  RequestedRegion: 
    Dimension: 3
    Index: [0, 0, 0]
    Size: [396, 92, 240]
  Spacing: [0.025, 0.025, 0.025]
  Origin: [0, 0, 0]
  Direction: 
1 0 0
0 1 0
0 0 1

  IndexToPointMatrix: 
0.025 0 0
0 0.025 0
0 0 0.025

  PointToIndexMatrix: 
40 0 0
0 40 0
0 0 40

  Inverse Direction: 
1 0 0
0 1 0
0 0 1

  PixelContainer: 
    ImportImageContainer (0x7f94be73cc20)
      RTTI typeinfo:   itk::ImportImageContainer<unsigned long, unsigned short>
      Reference Count: 1
      Modified Time: 5389
      Debug: Off
      Object Name: 
      Observers: 
        none
      Pointer: 0x120e54000
      Container manages memory: true
      Size: 8743680
      Capacity: 8743680
kkutten1 commented 8 years ago

This issue was resolved

gkiar commented 8 years ago

how? @kkutten1

kkutten1 commented 8 years ago

I got the token from @alee156. Since the was already registered to ARA the code failed since registration wasn't necessary.