Skip to content

Dtype convert updates#121

Closed
tonysyu wants to merge 5 commits intoscikit-image:masterfrom
tonysyu:dtype-convert-updates
Closed

Dtype convert updates#121
tonysyu wants to merge 5 commits intoscikit-image:masterfrom
tonysyu:dtype-convert-updates

Conversation

@tonysyu
Copy link
Copy Markdown
Member

@tonysyu tonysyu commented Feb 4, 2012

Multiple changes to skimage.util.dtype.convert. Note: this PR does not implement the proposed clipping change for conversion from int to uint.

Summary:

  • Fix casting error (only arises in development versions of Numpy)
  • Add tests for full coverage.
  • Assert that float images are between 0 and 1.
  • Fix test which used a float image exceeding 0 to 1 range.
  • Rename _convert to convert since this function will be used internally to convert to types not supported by img_as_float, img_as_byte, etc. For example, match_template is implemented in Cython with float32 values for speed. I did not really make convert public (i.e. I did not add it to __all__), but I'm inclined to do so (although the name might be a bit ambiguous for a public method).

This error only comes up in development versions of numpy, which refuses to cast the input to the correct type for inplace operations.
The extra dtype tests are not exhaustive, but, instead, were added to test specific code paths in `_convert`.
stefanv added a commit that referenced this pull request Feb 5, 2012
BUG: Clean up dtype conversion

- Fix casting error in numpy dev.
- Assert that float images are in [0, 1], and fix tests to comply.
- Add tests for full coverage.
- Rename _convert to convert since it is used by other modules,
  such as match_template, to convert to "non-standard" types such as
  float32.
@stefanv stefanv closed this Feb 5, 2012
emmanuelle added a commit to emmanuelle/scikit-image that referenced this pull request May 29, 2016
These corrections have also been submitted as a patch to the original
sphinx-gallery project (scikit-image#121)
emmanuelle added a commit to emmanuelle/scikit-image that referenced this pull request Jun 6, 2016
Removed a clumsy workaround (about paths)

Fixed links to image files to fix sphinx warning.

Removed non-ascii character

Another non ascii character

And another non-ascii character... (to be squashed later on)

Corrected some typos in the docstrings of sphinx-gallery files

These corrections have also been submitted as a patch to the original
sphinx-gallery project (scikit-image#121)

Corrected the appearance of two examples of the gallery

Tweaked CSS for larger images

Added sphinx-gallery's license and a README.txt about the origin of
this directory.

Edited gabor_from_astronaut example for nicer popup

PEP 8 + minor fixes

Removed commented lines of code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants