[SciPy-user] ndimage - why is output_type deprecated ?

Zachary Pincus zachary.pincus@yale....
Wed Apr 16 10:28:49 CDT 2008


Hello,

You want the 'output' parameter, which either takes a pre-allocated  
array, OR a dtype.

This is a bit confusing, overloaded-API-wise, and there's also a bug  
in (at least) ndimage.zoom with pre-allocated arrays(*). But the  
functionality is there.

Zach

* http://scipy.org/scipy/scipy/ticket/643


On Apr 16, 2008, at 4:23 AM, Sebastian Haase wrote:
> Hi,
>
> I have an 3d - image in uint8 pixel format and would like to use
> ndimage.gaussian_filter().
> The doctring says:
> """ .... The intermediate arrays are
>    stored in the same data type as the output. Therefore, for output
>    types with a limited precision, the results may be imprecise
>    because intermediate results may be stored with insufficient
>    precision.
> """
>
> Since I don't have an output array allocated a-priory, it would be
> convenient if I could specify that I want the output to be of dtype
> np.float32.
> So I thought about adding a "dtype" argument to the function
> definition in filters.py.
>
> However: I found that this function in turn calls
> _ni_support._get_output(output, input)
> and _ni_support._get_output(output, input)   already had an optional
> `output_type` argument,
> which however is "deprecated" -- really it causes even a "raise
> RuntimeError" (so it's actually already beyond deprecated ....)
>
> Does anyone here know why that was taken out !?
>
> I would like to put it back (just calling it "dtype=None" -- None
> meaning "same as input", and ignored [maybe one should raise an
> exception !?] if output is specified)
>
> Thanks,
> Sebastian Haase
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list