[Insight-users] ScalarImageToHistogramGenerator in Python

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Jun 1 08:58:22 EDT 2012


Hello,

What version of ITK and WrapITK are you using? What platform? What python? etc...

I am not sure how you are getting your list of methods. However I have the latest build from master and I get the following:

 dir( itk.ScalarImageToHistogramGenerator.IUC2.New() )
Out[12]: 
['AddObserver',
 'BreakOnError',
 'Clone',
 'Compute',
 'CreateAnother',
 'DebugOff',
 'DebugOn',
 'GetCommand',
 'GetDebug',
 'GetGlobalWarningDisplay',
 'GetMTime',
 'GetMetaDataDictionary',
 'GetNameOfClass',
 'GetOutput',
 'GetPointer',
 'GetReferenceCount',
 'GetTimeStamp',
 'GlobalWarningDisplayOff',
 'GlobalWarningDisplayOn',
 'HasObserver',
 'InvokeEvent',
 'Modified',
 'New',
 'Print',
 'RemoveAllObservers',
 'RemoveObserver',
 'SetDebug',
 'SetGlobalWarningDisplay',
 'SetHistogramMax',
 'SetHistogramMin',
 'SetInput',
 'SetMarginalScale',
 'SetMetaDataDictionary',
 'SetNumberOfBins',
 '__New_orig__',
 '__class__',
 '__delattr__',
 '__dict__',
 '__doc__',
 '__eq__',
 '__format__',
 '__getattribute__',
 '__hash__',
 '__init__',
 '__module__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__swig_destroy__',
 '__weakref__',
 'cast',
 'this',
 'thisown']


On Jun 1, 2012, at 2:42 AM, Rasmus Termo Lundsgaard wrote:

> Dear All!
> 
> I'm a fairly new user of ITK, and like it very much as I can implement it
> easily together with my other programming in Python.
> 
> I would like to perform a histogram calculation on som scalar images that I
> have, and I am trying to implement do it as in
> Examples/Statistics/ImageHistogram2.cxx but in Python.
> 
> the reader I write as
> 
> reader = itk.ImageFileReader.IUC2.New()
> 
> and was thinking that I could do the same with the
> itk.ScalarImageToHistogramGenerator but it doesn't work...
> 
> SIHG=itk.ScalarImageToHistogramGenerator.IUC2.New()
> 
> SIHG only have these subclasses then:
> SIHG.GetPointer  SIHG.IsNotNull   SIHG.IsNull      SIHG.Print
> SIHG.this        SIHG.thisown
> 
> ?!?
> 
> Whereas itk.ScalarImageToHistogramGenerator.IUC2 has:
> itk.ScalarImageToHistogramGenerator.IUC2.AddObserver
> itk.ScalarImageToHistogramGenerator.IUC2.BreakOnError
> itk.ScalarImageToHistogramGenerator.IUC2.Compute
> itk.ScalarImageToHistogramGenerator.IUC2.CreateAnother
> itk.ScalarImageToHistogramGenerator.IUC2.DebugOff
> itk.ScalarImageToHistogramGenerator.IUC2.DebugOn
> itk.ScalarImageToHistogramGenerator.IUC2.Delete
> itk.ScalarImageToHistogramGenerator.IUC2.GetCommand
> itk.ScalarImageToHistogramGenerator.IUC2.GetDebug
> itk.ScalarImageToHistogramGenerator.IUC2.GetGlobalWarningDisplay
> itk.ScalarImageToHistogramGenerator.IUC2.GetMTime
> itk.ScalarImageToHistogramGenerator.IUC2.GetMetaDataDictionary
> itk.ScalarImageToHistogramGenerator.IUC2.GetNameOfClass
> itk.ScalarImageToHistogramGenerator.IUC2.GetOutput
> itk.ScalarImageToHistogramGenerator.IUC2.GetReferenceCount
> itk.ScalarImageToHistogramGenerator.IUC2.GlobalWarningDisplayOff
> itk.ScalarImageToHistogramGenerator.IUC2.GlobalWarningDisplayOn
> itk.ScalarImageToHistogramGenerator.IUC2.HasObserver
> itk.ScalarImageToHistogramGenerator.IUC2.InvokeEvent
> itk.ScalarImageToHistogramGenerator.IUC2.Modified
> itk.ScalarImageToHistogramGenerator.IUC2.New
> itk.ScalarImageToHistogramGenerator.IUC2.Print
> itk.ScalarImageToHistogramGenerator.IUC2.Register
> itk.ScalarImageToHistogramGenerator.IUC2.RemoveAllObservers
> itk.ScalarImageToHistogramGenerator.IUC2.RemoveObserver
> itk.ScalarImageToHistogramGenerator.IUC2.SetDebug
> itk.ScalarImageToHistogramGenerator.IUC2.SetGlobalWarningDisplay
> itk.ScalarImageToHistogramGenerator.IUC2.SetHistogramMax
> itk.ScalarImageToHistogramGenerator.IUC2.SetHistogramMin
> itk.ScalarImageToHistogramGenerator.IUC2.SetInput
> itk.ScalarImageToHistogramGenerator.IUC2.SetMarginalScale
> itk.ScalarImageToHistogramGenerator.IUC2.SetMetaDataDictionary
> itk.ScalarImageToHistogramGenerator.IUC2.SetNumberOfBins
> itk.ScalarImageToHistogramGenerator.IUC2.SetReferenceCount
> itk.ScalarImageToHistogramGenerator.IUC2.UnRegister
> itk.ScalarImageToHistogramGenerator.IUC2.mro
> 
> How do I Implement this in Python?
> 
> Best regards
> Termo
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120601/85214e9d/attachment.htm>


More information about the Insight-users mailing list