Skip to content
Snippets Groups Projects
Commit b734bbec authored by Céline  TREBEAU's avatar Céline TREBEAU
Browse files

feature : Binning

- testing parameters
parent 6228b61e
No related branches found
No related tags found
1 merge request!41Resolve "Consider rescaling (binning) large images"
......@@ -50,7 +50,7 @@ public class Zellige extends ContextCommand
.getPath( "" )
.toAbsolutePath()
.toString();
String imageFilePath = "doc/Mouche.tif";
String imageFilePath = "doc/Scan1_volume_crop.tif";
// Launch ImageJ.
ImageJ ij = new ImageJ();
......
......@@ -77,7 +77,7 @@ public class Pretreatment< T extends RealType< T > & NativeType< T > >
LOGGER.debug( "Starting process..." );
try
{
Img< T > temp = Binning.binning( input, getBin() ); // Binning op
Img< T > temp = Binning.run( input, getBin() ); // Binning op
if (temp == null)
{
throw new BinningFailedException();
......@@ -151,7 +151,7 @@ public class Pretreatment< T extends RealType< T > & NativeType< T > >
ImageJFunctions.show( kernel, "original" );
double time1 = System.currentTimeMillis();
int bin = 1;
Img< UnsignedByteType > output = Binning.binning( kernel, bin );
Img< UnsignedByteType > output = Binning.run( kernel, bin );
double time2 = System.currentTimeMillis();
LOGGER.debug( "Multithreading time = {}s", ( time2 - time1 ) / 1000 );
assert output != null;
......
......@@ -58,7 +58,7 @@ public class ZParameters
double startingThreshold2, int overlap2, double connexityRate2,
double surfaceMinSizeFactor, int delta ) throws DataValidationException
{
pretreatmentParameters = new PretreatmentParameters( filter, filterParameter );
pretreatmentParameters = new PretreatmentParameters( filter, filterParameter, 2);
classificationParameters = new ClassificationParameters( amplitudeThreshold, otsuThreshold );
postTreatmentParameters = new PostTreatmentParameters( XYSmoothing, ZSmoothing, ISSize, ISConnexity );
......@@ -97,7 +97,7 @@ public class ZParameters
public void print()
{
LOGGER.debug( "method : " + pretreatmentParameters.getMethod() );
LOGGER.debug( "parameter : " + pretreatmentParameters.getParameter() );
LOGGER.debug( "parameter : " + pretreatmentParameters.getRadius() );
LOGGER.debug( "amplitude : " + classificationParameters.getAmplitudeThreshold() );
LOGGER.debug( "threshold : " + classificationParameters.getOtsuThreshold() );
LOGGER.debug( "connexity : " + postTreatmentParameters.getConnexity() );
......
......@@ -74,7 +74,7 @@ public class StartingOSESameSurfaceTest
double startingSizeThreshold = 0.9;
int overlap = 10;
double connexity = 0.5;
PretreatmentParameters pretreatmentParameters = new PretreatmentParameters( "GaussianBlur", 2 );
PretreatmentParameters pretreatmentParameters = new PretreatmentParameters( "GaussianBlur", 2,1 );
ClassificationParameters classificationParameters = new ClassificationParameters( amplitude, otsu );
PostTreatmentParameters postTreatmentParameters = new PostTreatmentParameters( sigmaXY, sigmaZ, 5, 8 );
......@@ -83,7 +83,7 @@ public class StartingOSESameSurfaceTest
@SuppressWarnings( "unchecked" )
final Img< T > source = ( Img< T > ) imgPlus.getImg();
Pixels[][] maximums = Selection.run( source, pretreatmentParameters, classificationParameters, postTreatmentParameters );
Pixels[][] maximums = Selection.run( source, source.factory(), pretreatmentParameters, classificationParameters, postTreatmentParameters );
OSEListArray oseLists = OseConstructionXZ.run( maximums, startingSizeThreshold );
int width = maximums[ 0 ].length;
......
......@@ -50,7 +50,7 @@ public class PretreatmentParametersTest
@CsvSource( { GAUSSIAN_BLUR + ", 1" } )
void rightMethodWithRightParameterValue_whenChecked_doesntRaiseAnyException( String method, double value )
{
assertDoesNotThrow( () -> new PretreatmentParameters( method, value ) );
assertDoesNotThrow( () -> new PretreatmentParameters( method, value,1 ) );
}
@DisplayName( "A wrong method should raise DataValidationException for any method" )
......@@ -58,7 +58,7 @@ public class PretreatmentParametersTest
void wrongDenoisingMethod_whenChecked_RaisesADataValidationException()
{
DataValidationException exception = assertThrows( DataValidationException.class, () ->
new PretreatmentParameters( "Wrong method", 15 ) );
new PretreatmentParameters( "Wrong method", 15, 1) );
assertThat( exception ).hasMessageContaining( NOT_IMPLEMENTED );
}
......@@ -68,7 +68,7 @@ public class PretreatmentParametersTest
void gaussianBlurMethodWithLessThanThreeParameter_whenChecked_RaisesAnException( String method )
{
double value = - 1;
DataValidationException exception = assertThrows( DataValidationException.class, () -> new PretreatmentParameters( method, value ) );
DataValidationException exception = assertThrows( DataValidationException.class, () -> new PretreatmentParameters( method, value, 1) );
assertThat( exception ).hasMessageContaining( "parameter value" );
}
......@@ -77,7 +77,7 @@ public class PretreatmentParametersTest
void parameterValueSuperiorTo10_whenChecked_RaisesADataValidationException()
{
DataValidationException exception = assertThrows( DataValidationException.class, () ->
new PretreatmentParameters( GAUSSIAN_BLUR, 15 ) );
new PretreatmentParameters( GAUSSIAN_BLUR, 15, 1) );
assertThat( exception ).hasMessageContaining( "parameter value" );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment