Skip to content

Conversation

@stelfrich
Copy link
Contributor

Adds a test that fails prior to #30.

Copy link
Member

@hanslovsky hanslovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A list of small modifications that improve readability.

Img< ByteType > in = new ArrayImgFactory< ByteType >().create( new FinalDimensions( 3, 3 ), new ByteType() );
OutOfBoundsFactory< ByteType, RandomAccessibleInterval< ByteType > > outOfBoundsFactory =
new OutOfBoundsBorderFactory<>();
RandomAccessibleInterval< ByteType > extendedIn = Views.interval( Views.extend( in, outOfBoundsFactory ), in );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Views.extendBorder instead of creating a separate factory.

RandomAccessibleInterval< ByteType > extendedIn = Views.interval( Views.extend( in, outOfBoundsFactory ), in );

// Create RandomAccessiblePair
final RandomAccessible< Neighborhood< ByteType > > safe = new RectangleShape( 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1, should be in a new line like this (with appropriate indentation):

... = new RectangleShape( 
				1,
				false )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hanslovsky I have added an additional comment in the opening line so that the formatter doesn't try to move the 1 to the first line every time it's run. Let me know if I should remove it or keep it that way...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's interesting. Are you using eclipse? I have noticed that the eclipse formatter is not always consistent among different machines (probably dependent on what settings are being used). I think the comment is fine here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using Eclipse Neon on macOS with a weird configuration (that I don't have a clue where I got it from) instead of the imglib2-eclipse-mars-clean-up-formatter-style.xml. Sorry for the confusion!

RandomAccessible< Pair< Neighborhood< ByteType >, ByteType > > pair = Views.pair( safe, extendedIn );

// Set position out of bounds
RandomAccess< Pair< Neighborhood< ByteType >, ByteType > > randomAccess = pair
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for line break here (there are longer lines in this file).

@hanslovsky hanslovsky self-assigned this Jan 23, 2018
@stelfrich stelfrich force-pushed the randomaccessiblepair-test branch from 4350648 to 8ac641e Compare February 6, 2018 17:40
@stelfrich
Copy link
Contributor Author

Thanks for looking at this @hanslovsky! I have added a comment to one of yours for your review.

@hanslovsky hanslovsky merged commit bc16b2e into imglib:master Feb 6, 2018
@stelfrich stelfrich deleted the randomaccessiblepair-test branch February 7, 2018 07:00
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