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

Refactor : Replacement of primitive type float by primitive type double

parent 457b3f48
No related branches found
No related tags found
1 merge request!10Surface reconstruction Refactoring
......@@ -63,9 +63,9 @@ public class Main
// Input of the image.
final String imagePath =
"doc/STK_060.tif";
// "doc/STK_060.tif";
// "C:\\Users\\ctrebeau\\Desktop\\MoucheAile\\STK\\STK_Mouche_c01_f0001_p005.tif";
// "C:\\Users\\ctrebeau\\Downloads\\phantom3_combined.tif";
"C:\\Users\\ctrebeau\\Downloads\\phantom3_combined.tif";
// "C:\\Users\\ctrebeau\\Desktop\\HighRes\\STK_170706_Vangl2-Lp-wt_E14.5_Phall_cochlea_01bHighRes_c01_f0001_p005.tif";
System.out.println(imagePath);
// Creation of the image : version with unsigned type. */
......
......@@ -129,8 +129,8 @@ public class LocalOtsuClassification
{
sourceCursor.fwd();
outputCursor.fwd();
final float s = sourceCursor.get().getRealFloat();
final float o = outputCursor.get().getRealFloat();
final double s = sourceCursor.get().getRealDouble();
final double o = outputCursor.get().getRealDouble();
{
if (s >= Math.max( o, threshold))// background subtraction
{
......
......@@ -91,7 +91,7 @@ public class MaximumAmplitudeClassification
{
maxAccess.setPosition( z, 2 );
float maxValue = maxAccess.get().getRealFloat();
double maxValue = maxAccess.get().getRealDouble();
if ( maxValue != 0 )
{
minAccess.setPosition( maxAccess );
......@@ -112,7 +112,7 @@ public class MaximumAmplitudeClassification
* @param <T> the type of the {@link RandomAccess}
* @return the chosen amplitude value of the local maximum positioned at minAccess location
*/
private static < T extends RealType< T > & NativeType< T > > double getAmplitude( float maxValue, RandomAccess< T > minAccess , int depth)
private static < T extends RealType< T > & NativeType< T > > double getAmplitude( double maxValue, RandomAccess< T > minAccess , int depth)
{
double up = findValueUp( minAccess, maxValue );
double down = findValueDown( minAccess, maxValue , depth);
......@@ -133,7 +133,7 @@ public class MaximumAmplitudeClassification
* @return the amplitude value above the local maximum location in the Z dimension
*/
private static < T extends RealType< T > & NativeType< T > > double findValueUp(
RandomAccess< T > minAccess, float maxValue )
RandomAccess< T > minAccess, double maxValue )
{
int start = minAccess.getIntPosition( 2 );
for ( int z = start - 1; z >= 0; z-- )
......@@ -156,7 +156,7 @@ public class MaximumAmplitudeClassification
* @return the amplitude value below the local maximum location in the Z dimension
*/
private static < T extends RealType< T > & NativeType< T > > double findValueDown(
RandomAccess< T > minAccess, float maxValue, int depth )
RandomAccess< T > minAccess, double maxValue, int depth )
{
int start = minAccess.getIntPosition( 2 );
for ( int z = start + 1; z <= depth - 1; z++ )
......
......@@ -342,7 +342,7 @@ public class StackProjection
for ( int y = 0; y <= input.dimension( 1 ) - 1; y++ )
{
inputAccess.setPosition( y, 1 );
float[] column = new float[ ( int ) input.dimension( 2 ) ];
double[] column = new double[ ( int ) input.dimension( 2 ) ];
for ( int z = 0; z <= input.dimension( 2 ) - 1; z++ )
{
inputAccess.setPosition( z, 2 );
......@@ -357,9 +357,9 @@ public class StackProjection
static float median( float[] a )
static double median( double[] a )
{
float[] sorted = a.clone();
double[] sorted = a.clone();
Arrays.sort( sorted );
int middle = a.length / 2;
......
......@@ -104,7 +104,7 @@ public class SurfacePixelSelection
{
for ( int z = 0; z <= stack.dimension( 2 ) - 1; z++ )
{
float value = Utils.setPositionAndGet( access, x, y, z ).getRealFloat();
double value = Utils.setPositionAndGet( access, x, y, z ).getRealDouble();
if ( value > 0 )
{
if ( pixels[ y ][ x ] == null )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment