From 992de2bfb1142baa54bab979ab6f655b75fa13d4 Mon Sep 17 00:00:00 2001 From: Fusion86 Date: Mon, 25 Sep 2023 17:30:35 +0200 Subject: [PATCH] Keep stack slice labels intact --- mpicbg_/src/main/java/SIFT_Align.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mpicbg_/src/main/java/SIFT_Align.java b/mpicbg_/src/main/java/SIFT_Align.java index 603b5194..babfced1 100644 --- a/mpicbg_/src/main/java/SIFT_Align.java +++ b/mpicbg_/src/main/java/SIFT_Align.java @@ -195,7 +195,7 @@ final public void run( final String args ) Math.round( vis_scale * stack.getHeight() ) ); final ImageProcessor firstSlice = stack.getProcessor( 1 ); - stackAligned.addSlice( null, firstSlice.duplicate() ); + stackAligned.addSlice( stack.getSliceLabel(1), firstSlice.duplicate() ); stackAligned.getProcessor( 1 ).setMinAndMax( firstSlice.getMin(), firstSlice.getMax() ); final ImagePlus impAligned = new ImagePlus( "Aligned 1 of " + stack.getSize(), stackAligned ); impAligned.show(); @@ -364,16 +364,17 @@ final public void run( final String args ) else mapping.map( originalSlice, alignedSlice ); - stackAligned.addSlice( null, alignedSlice ); + String sliceLabel = stack.getSliceLabel( i + 1 ); + stackAligned.addSlice( sliceLabel, alignedSlice ); if ( p.showInfo ) { ImageProcessor tmp; tmp = ip3.createProcessor( stackInfo.getWidth(), stackInfo.getHeight() ); tmp.insert( ip3, 0, 0 ); - stackInfo.addSlice( null, tmp ); // fixing silly 1 pixel size missmatches + stackInfo.addSlice( sliceLabel, tmp ); // fixing silly 1 pixel size missmatches tmp = ip4.createProcessor( stackInfo.getWidth(), stackInfo.getHeight() ); tmp.insert( ip4, 0, 0 ); - stackInfo.addSlice( null, tmp ); + stackInfo.addSlice( sliceLabel, tmp ); if ( i == 1 ) { impInfo = new ImagePlus( "Alignment info", stackInfo );