Skip to content

Commit 0982347

Browse files
support mapping of viewsetups for fusion, so any order can be achieved
1 parent c6faf92 commit 0982347

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/java/net/preibisch/mvrecon/process/fusion/blk/BlkAffineFusion.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static < T extends RealType< T > & NativeType< T > > BlockSupplier< T > i
128128
final T type,
129129
final int[] blockSize )
130130
{
131-
return init( converter, imgloader, viewIds, viewRegistrations, viewDescriptions, fusionType, interpolationMethod,
131+
return init( converter, imgloader, viewIds, viewRegistrations, viewDescriptions, fusionType, null, interpolationMethod,
132132
intensityAdjustments, null,
133133
fusionInterval, type, blockSize );
134134
}
@@ -140,13 +140,14 @@ public static < T extends RealType< T > & NativeType< T > > BlockSupplier< T > i
140140
final Map< ViewId, ? extends AffineTransform3D > viewRegistrations,
141141
final Map< ViewId, ? extends BasicViewDescription< ? > > viewDescriptions,
142142
final FusionType fusionType,
143+
final Map< Integer, Integer > fusionMap, // old setupId > new setupId for fusion order, only makes sense with FusionType.FIRST_LOW or FusionType.FIRST_HIGH
143144
final int interpolationMethod,
144145
final Map< ViewId, Coefficients > intensityAdjustments,
145146
final Interval fusionInterval,
146147
final T type,
147148
final int[] blockSize )
148149
{
149-
return init( converter, imgloader, viewIds, viewRegistrations, viewDescriptions, fusionType, interpolationMethod,
150+
return init( converter, imgloader, viewIds, viewRegistrations, viewDescriptions, fusionType, fusionMap, interpolationMethod,
150151
null, intensityAdjustments,
151152
fusionInterval, type, blockSize );
152153
}
@@ -158,6 +159,7 @@ private static < T extends RealType< T > & NativeType< T > > BlockSupplier< T >
158159
final Map< ViewId, ? extends AffineTransform3D > viewRegistrations,
159160
final Map< ViewId, ? extends BasicViewDescription< ? > > viewDescriptions,
160161
final FusionType fusionType,
162+
final Map< Integer, Integer > fusionMap, // old setupId > new setupId for fusion order, only makes sense with FusionType.FIRST_LOW or FusionType.FIRST_HIGH
161163
final int interpolationMethod,
162164
final Map< ViewId, AffineModel1D > intensityAdjustmentModels,
163165
final Map< ViewId, Coefficients > intensityAdjustmentCoefficients,
@@ -188,7 +190,11 @@ private static < T extends RealType< T > & NativeType< T > > BlockSupplier< T >
188190

189191
// to be able to use the "lowest ViewId" wins strategy
190192
final List< ? extends ViewId > sortedViewIds = new ArrayList<>( viewIds );
191-
Collections.sort( sortedViewIds );
193+
194+
if ( fusionMap == null || fusionMap.size() == 0 )
195+
Collections.sort( sortedViewIds );
196+
else
197+
Collections.sort( sortedViewIds, (c1,c2) -> Integer.compare( fusionMap.get( c1.getViewSetupId() ), fusionMap.get( c2.getViewSetupId() ) ) );
192198

193199
// Which views to process (use un-altered bounding box and registrations).
194200
// Final filtering happens per Cell.

0 commit comments

Comments
 (0)