Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/stackImagePositionSynchronizer does not crash if no position found #246

Merged
merged 14 commits into from
Nov 23, 2017
Merged

Feature/stackImagePositionSynchronizer does not crash if no position found #246

merged 14 commits into from
Nov 23, 2017

Conversation

adreyfus
Copy link
Member

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 3.85% when pulling 10231d3 on adreyfus:feature/stackImagePositionSynchronizer_does_not_crash_if_no_position_found into bd57176 on chafey:master.

Aloïs Dreyfus added 6 commits September 27, 2017 11:58
fusionRenderer does not crash if the layer is destroyed while rendering (#245)
LengthTool now uses PixelSpacing provided by MetaDataProvider, thanks…
…r_does_not_crash_if_no_position_found

# Conflicts:
#	src/synchronization/stackImagePositionSynchronizer.js
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 3.791% when pulling 9d79ae4 on adreyfus:feature/stackImagePositionSynchronizer_does_not_crash_if_no_position_found into c6f12bf on chafey:master.


const stackToolDataSource = getToolState(targetElement, 'stack');
const stackData = stackToolDataSource.data[0];

let minDistance = Number.MAX_VALUE;
let newImageIdIndex = -1;
let nbComparedPositions = 0;
Copy link
Member

Choose a reason for hiding this comment

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

I guess this is a remnant of testing? If you remove nbComparedPositions I think we can merge this PR

sourceImagePosition = convertToVector3(sourceImagePlane.imagePositionPatient);
}

if (sourceImagePosition === undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

I just realized there is no way this condition can happen. convertToVector3 doesn't have any way to return undefined. I guess it's better to move this If statement above the other one and check if sourceImagePlane.imagePositionPatient is undefined.

See https://github.com/chafey/cornerstoneTools/blob/55226c082b2e5ab2de57b6e2bdb82c072eafd516/src/util/convertToVector3.js#L9

Copy link
Member Author

Choose a reason for hiding this comment

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

Done !

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 3.794% when pulling 89845ee on adreyfus:feature/stackImagePositionSynchronizer_does_not_crash_if_no_position_found into c6f12bf on chafey:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.006%) to 3.795% when pulling d050db8 on adreyfus:feature/stackImagePositionSynchronizer_does_not_crash_if_no_position_found into c6f12bf on chafey:master.

@swederik
Copy link
Member

That looks better! Thanks!

@swederik swederik merged commit 3f32ef0 into cornerstonejs:master Nov 23, 2017
@adreyfus adreyfus deleted the feature/stackImagePositionSynchronizer_does_not_crash_if_no_position_found branch November 23, 2017 12:16
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.

None yet

3 participants