# add example SDR for binary and fuzzy images #1561

Merged
merged 3 commits into from Jun 29, 2018

## Conversation

Projects
None yet
5 participants
Contributor

### Borda commented Jun 11, 2018

 Writing a simple example of registering binary and fuzzy images together with addressing tuning some particular parameters. see #1541
``` add example SDR for binary and fuzzy images ```
``` 6790d86 ```

### pep8speaks commented Jun 11, 2018 • edited

Hello @Borda, Thank you for updating !

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Closed

Member

### arokem left a comment

 Thanks for this example! I had a few suggestions for changes in wording.
 Diffeomorphic Registration with binary and fuzzy images ========================================================= This example for registering binary and fuzzy images together. This may be seen as aligning sensed (fuzzy) image to the

#### arokem Jun 12, 2018

Member

Typo: "to the and"

How about rewriting these two sentences as.

"This example demonstrates registration of a binary and a fuzzy image. This could be seen as aligning a fuzzy (sensed) image to a binary (e.g., template) image."

 from dipy.viz import regtools """ Let's generate sample template image as combination of three ellipses.

#### arokem Jun 12, 2018

Member

=> "Let's generate a sample template image as the combination of three ellipses"

 """ Let's generate sample template image as combination of three ellipses. The fuzzy (sensed) is a smooth version of the reference image.

#### arokem Jun 12, 2018

Member

=> "We will generate the fuzzy (sensed) version of the image by smoothing the reference image"

 img_in = filters.gaussian(img_ref, sigma=3) """ Let's write down a short visualisation function.

#### arokem Jun 12, 2018

Member

=> "Let's define a small visualization function"

 """ """ Let's use the use the general Registration function with some naive parameters,

#### arokem Jun 12, 2018

Member

The words "use the" are duplicated.

 """ Unfortunately, we did not realised that we are still using multi scale approach which makes `step_length` in the upper level multiplicatively larger. Let's experiment with `step_length` and set as quite small.

#### arokem Jun 12, 2018

Member

How about changing this sentence to a question? Like so:

"What happens if we set `step_length` to a rather small value?"

 sdr.step_length = 0.1 """ Perform the registration and see output.

#### arokem Jun 12, 2018

Member

=> "Perform the registration and examine the output."

 .. figure:: map-2.png :align: center Registration results for decrease learning step.

#### arokem Jun 12, 2018

Member

=> "Registration results for decreased step size."

 """ """ Another alternative for such scenario is using just single scale level.

#### arokem Jun 12, 2018

Member

=> "An alternative scenario is to use just a single scale level"

 """ Another alternative for such scenario is using just single scale level. Although the warped image may look fine the estimated deformations is quite wild.

#### arokem Jun 12, 2018

Member

=> "Even though the warped image may look fine, the estimated deformations show that it is off the mark."

Member

### arokem commented Jun 12, 2018

 Also, once you've made these changes, please take a look at the results from PEP8 speaks. In particular, it looks as though your editor is not set to remove trailing white-spaces, so please do remove these by hand.

# Codecov Report

Merging #1561 into master will decrease coverage by `<.01%`.
The diff coverage is `n/a`.

```@@            Coverage Diff             @@
##           master    #1561      +/-   ##
==========================================
- Coverage   87.42%   87.42%   -0.01%
==========================================
Files         246      246
Lines       31458    31458
Branches     3425     3425
==========================================
- Hits        27502    27501       -1
Misses       3144     3144
- Partials      812      813       +1```
Impacted Files Coverage Δ
dipy/core/graph.py `73.8% <0%> (-1.2%)` ⬇️

`Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`

Contributor

### Borda commented Jun 13, 2018

 @arokem thanks for help with the rewording :)

Member

### arokem left a comment

 Still a couple more comments left unaddressed. Once those are in, I am +1 for merging this. Could someone else also take a look, please?
 opt_tol=1.e-3) """ Perform the registration in equal images.

#### arokem Jun 15, 2018

Member

Still needs rewording here.

 """ """ Perform the registration on binary and fuzzy images.

Member

And here

Contributor

### Borda commented Jun 15, 2018

 ok, and what do you recommend for these tows?
Member

### arokem commented Jun 15, 2018

 Oh - sorry - these were in my previous inline comments:
``` update text for example ```
``` 8fc44dd ```

Contributor

### Borda commented Jun 15, 2018

 btw, Travis: `The log length has exceeded the limit of 4 MB (this usually means that the test suite is raising the same exception over and over).`
Member

### arokem commented Jun 16, 2018

 Yeah - that's unrelated. It's due to a new version of numpy (?). Also reported on #1565
Member

### arokem commented Jun 16, 2018

 This PR is 👍 for the merge from my side.
Contributor

### Borda commented Jun 25, 2018

 @arokem or anyone else, any other comment? :)
Member

### skoudoro commented Jun 25, 2018 • edited

 Nice Tutorial, Thanks @Borda! Can you add your example in valid_examples and in examples index list please. Thank you
``` add example to lists ```
``` 8e67db3 ```
Contributor

### Borda commented Jun 27, 2018

 @skoudoro done :)
Member

### arokem commented Jun 29, 2018

 Since no one had any more comments here, I am going to go ahead and merge this.

### arokem merged commit `9015dca` into nipy:master Jun 29, 2018 1 check failed

#### 1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

### ShreyasFadnavis pushed a commit to ShreyasFadnavis/dipy that referenced this pull request Sep 20, 2018

``` Merge pull request nipy#1561 from Borda/example-sdr ```
`add example SDR for binary and fuzzy images`
``` df465fd ```