Skip to content

Commit

Permalink
Merge pull request #67 from Fusion86/master
Browse files Browse the repository at this point in the history
SIFT Align: keep stack slice labels intact
  • Loading branch information
axtimwalde authored Feb 22, 2024
2 parents 7879691 + 992de2b commit 3c2fb01
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mpicbg_/src/main/java/SIFT_Align.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 3c2fb01

Please sign in to comment.