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

Feature : batch mode

parent f52e8300
No related branches found
No related tags found
2 merge requests!47Feature : Multi-channel and Binning,!41Resolve "Consider rescaling (binning) large images"
......@@ -61,69 +61,69 @@ public class ZelligePipelineAnalyse< T extends RealType< T > & NativeType< T >,
}
@SuppressWarnings( { "unchecked", "rawtypes" } )
public void run( final ZParameters parameters, final Img< R > tested, final ArrayList< Img > GT ) throws Exception
{
long startTime = System.currentTimeMillis();
ImgFactory< R > factory = tested.factory();
extraction = new ReferenceSurfaceExtraction<>();
long extractionStartTime = System.currentTimeMillis();
extraction.select(tested, parameters.getPretreatmentParameters(), parameters.getClassificationParameters(), parameters.getPostTreatmentParameters() );
long extractionStopTime = System.currentTimeMillis();
selectionProcessingTime = extractionStopTime - extractionStartTime;
LOGGER.debug( "Extraction processing time : {} ms", selectionProcessingTime );
selectedPixelNumber = getPixelNumber( extraction.getMaximums() );
int index = 0;
long stopTime = 0;
try
{
extractionStartTime = System.currentTimeMillis();
extraction.construct(tested, factory, parameters.getConstructionParameters() );
stopTime = System.currentTimeMillis();
constructionProcessingTime = stopTime - extractionStartTime;
LOGGER.debug( "Construction processing time : {} ms", constructionProcessingTime );
ArrayList< ReferenceSurface< R > > surfaces = extraction.getReferenceSurfaces();
for ( Img refImage : GT )// Parsing of GT list.
{
index++;
ArrayList< RMSEAndCoverageComputation< T, UnsignedShortType > > tempList = new ArrayList<>();
for ( ReferenceSurface< R > rf : surfaces )// Test of each reconstructed surface
{
RMSEAndCoverageComputation< T, UnsignedShortType > errors =
new RMSEAndCoverageComputation<>( refImage, index, rf.getzMap() );
errors.compute();
tempList.add( errors );
}
RMSEAndCoverageComputation< T, UnsignedShortType > finalError = findRightSurface( tempList );
this.errorList.add( finalError );
}
}
catch ( NotAnHeightMapException h )
{
LOGGER.debug( " Exception raised for ref n°{} " , index );
}
catch ( NoSurfaceFoundException s )
{
stopTime = System.currentTimeMillis();
LOGGER.debug( "An NoSurfaceFoundException was raised" );
constructionProcessingTime = stopTime - extractionStartTime;
for ( int i = 0; i < GT.size(); i++ )
{
index++;
RMSEAndCoverageComputation< T, UnsignedShortType > errors =
new RMSEAndCoverageComputation<>( index );
this.errorList.add( errors );
}
LOGGER.debug( "Construction processing time : {} ms", constructionProcessingTime );
}
catch ( Exception n )
{
LOGGER.debug( "An {} was raised", n.getClass() );
}
this.processingTime = ( stopTime - startTime );
}
// public void run( final ZParameters parameters, final Img< R > tested, final ArrayList< Img > GT ) throws Exception
// {
// long startTime = System.currentTimeMillis();
// ImgFactory< R > factory = tested.factory();
//
// extraction = new ReferenceSurfaceExtraction<>();
// long extractionStartTime = System.currentTimeMillis();
// extraction.select(tested, parameters.getPretreatmentParameters(), parameters.getClassificationParameters(), parameters.getPostTreatmentParameters() );
// long extractionStopTime = System.currentTimeMillis();
// selectionProcessingTime = extractionStopTime - extractionStartTime;
// LOGGER.debug( "Extraction processing time : {} ms", selectionProcessingTime );
// selectedPixelNumber = getPixelNumber( extraction.getMaximums() );
// int index = 0;
// long stopTime = 0;
// try
// {
// extractionStartTime = System.currentTimeMillis();
// extraction.construct(tested, factory, parameters.getConstructionParameters() );
// stopTime = System.currentTimeMillis();
// constructionProcessingTime = stopTime - extractionStartTime;
// LOGGER.debug( "Construction processing time : {} ms", constructionProcessingTime );
// ArrayList< ReferenceSurface< R > > surfaces = extraction.getReferenceSurfaces();
//
// for ( Img refImage : GT )// Parsing of GT list.
// {
// index++;
// ArrayList< RMSEAndCoverageComputation< T, UnsignedShortType > > tempList = new ArrayList<>();
// for ( ReferenceSurface< R > rf : surfaces )// Test of each reconstructed surface
// {
// RMSEAndCoverageComputation< T, UnsignedShortType > errors =
// new RMSEAndCoverageComputation<>( refImage, index, rf.getzMap() );
// errors.compute();
// tempList.add( errors );
// }
// RMSEAndCoverageComputation< T, UnsignedShortType > finalError = findRightSurface( tempList );
// this.errorList.add( finalError );
// }
// }
// catch ( NotAnHeightMapException h )
// {
// LOGGER.debug( " Exception raised for ref n°{} " , index );
// }
//
// catch ( NoSurfaceFoundException s )
// {
// stopTime = System.currentTimeMillis();
// LOGGER.debug( "An NoSurfaceFoundException was raised" );
// constructionProcessingTime = stopTime - extractionStartTime;
// for ( int i = 0; i < GT.size(); i++ )
// {
// index++;
// RMSEAndCoverageComputation< T, UnsignedShortType > errors =
// new RMSEAndCoverageComputation<>( index );
// this.errorList.add( errors );
// }
// LOGGER.debug( "Construction processing time : {} ms", constructionProcessingTime );
// }
// catch ( Exception n )
// {
// LOGGER.debug( "An {} was raised", n.getClass() );
// }
// this.processingTime = ( stopTime - startTime );
// }
private int getPixelNumber( Img<FloatType> maximumCoordinates )
{
......
......@@ -13,12 +13,16 @@
<HBox prefHeight="26.0" prefWidth="399.0" spacing="10">
<TextField fx:id="filePathField" editable="false" prefWidth="300" />
<Button onAction="#handleBrowse" text="Browse" />
<Button text="Browse" >
<onAction>#handleBrowse</onAction>
</Button>
<padding>
<Insets left="10.0" right="10.0" />
</padding>
</HBox>
<Button onAction="#handleRun" text="Run" />
<Button text="Run" >
<onAction>#handleRun</onAction>
</Button>
</fx:root>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment