src/main/java/sc/fiji/pQCT/selectroi/RoiSelector.java
private static boolean guessFlipSelection(final ArrayList<DetectedEdge> edges,
		final int selection, final boolean stacked)
	{

		final int[] considered = twoLargestBonesDetectedEdges(edges);
		if (selection != considered[0] && selection != considered[1]) {
			// selection is not the biggest or the second biggest bone -> can't make a
			// guess, return false
			return false;
		}

		final int[] possibleCoords;
		final int selectionCoord;
		final DetectedEdge first = edges.get(considered[0]);
		final DetectedEdge second = edges.get(considered[1]);
		if (stacked) {
			selectionCoord = edges.get(selection).jiit.get(0);
			possibleCoords = new int[] { first.jiit.get(0), second.jiit.get(0) };
		}
		else {
			selectionCoord = edges.get(selection).iit.get(0);
			possibleCoords = new int[] { first.iit.get(0), second.iit.get(0) };
		}
		return (selection == considered[0] && selectionCoord > possibleCoords[1]) ||
			(selection == considered[1] && selectionCoord > possibleCoords[0]);
	}
// DetectedEdge Only two biggest bone will be considered..
DetectedEdge Only two biggest bone will be considered
DetectedEdge Only two biggest bone will be considered
private static boolean guessFlipSelection(final ArrayList<DetectedEdge> edges,
		final int selection, final boolean stacked)
	{
		final int[] considered = twoLargestBonesDetectedEdges(edges);
		if (selection != considered[0] && selection != considered[1]) {
			return false;
		}
		final int[] possibleCoords;
		final int selectionCoord;
		final DetectedEdge first = edges.get(considered[0]);
		final DetectedEdge second = edges.get(considered[1]);
		if (stacked) {
			selectionCoord = edges.get(selection).jiit.get(0);
			possibleCoords = new int[] { first.jiit.get(0), second.jiit.get(0) };
		}
		else {
			selectionCoord = edges.get(selection).iit.get(0);
			possibleCoords = new int[] { first.iit.get(0), second.iit.get(0) };
		}
		return (selection == considered[0] && selectionCoord > possibleCoords[1]) ||
			(selection == considered[1] && selectionCoord > possibleCoords[0]);
	}
private static boolean guessFlipSelection ( final ArrayList < DetectedEdge > edges , final int selection , final boolean stacked ) { final int [ ] considered = twoLargestBonesDetectedEdges ( edges ) ; if ( selection != considered [ 0 ] && selection != considered [ 1 ] ) { return false ; } final int [ ] possibleCoords ; final int selectionCoord ; final DetectedEdge first = edges . get ( considered [ 0 ] ) ; final DetectedEdge second = edges . get ( considered [ 1 ] ) ; if ( stacked ) { selectionCoord = edges . get ( selection ) . jiit . get ( 0 ) ; possibleCoords = new int [ ] { first . jiit . get ( 0 ) , second . jiit . get ( 0 ) } ; } else { selectionCoord = edges . get ( selection ) . iit . get ( 0 ) ; possibleCoords = new int [ ] { first . iit . get ( 0 ) , second . iit . get ( 0 ) } ; } return ( selection == considered [ 0 ] && selectionCoord > possibleCoords [ 1 ] ) || ( selection == considered [ 1 ] && selectionCoord > possibleCoords [ 0 ] ) ; }
DetectedEdge Only two biggest bone will be considered..
DetectedEdge Only two biggest bone will be considered ..
// selection is not the biggest or the second biggest bone -> can't make a // guess, return false