tinevez on auto-linking-mode
Aut-linking mode for BDV. When… (compare)
tinevez on dev
Add a link to the documentation… (compare)
tinevez on dev
Remove the new* and import* com… Add a menu text for the Save As… Loading a project counts as set… (compare)
tinevez on save-on-close-v2
tinevez on dev
Temporary couple to SNAPSHOT ve… Model exposes methods to set sa… Saving the project sets the mod… and 2 more (compare)
tinevez on save-on-close-v2
Temporary couple to SNAPSHOT ve… Model exposes methods to set sa… Saving the project sets the mod… and 1 more (compare)
Regions.iterable(RAI<B>)
to retrieve those?
RandomAccessibleInterval<BooleanType>
, IterableRegion<BooleanType>
, PositionableIterableRegion<BooleanType>
into this sequence such that the Regions
methods that "add capabilities" (being iterable, positionable) can have appropriate result types."
Regions
methods exposing it. But I don't see them.
LocalizableIterableRegion
. Not Positionable
. Right? I think the latter is more complex.
IterableRegion
does have a localizingCursor
method.
IterableRegion
(similar to RAI and II) does not have a position. But it can give you accessors that do.
IterableRegion<T extends BooleanType<T>> extends IterableInterval<Void>
. So... the cursor()
method returns Cursor<Void>
. So that you can iterate the positions, but you can't access sample values because there is nothing to access (the backing region is just true
at those spots, always).
RealMaskRealInterval myMask = ...;
RandomAccessible<T> myImage = ...;
IterableInterval<T> myMaskedImage = Regions.sample(myMask, myImage);
Cursor<T> c = myMaskedImage.localizingCursor();
long[] pos = new long[c.numDimensions()];
while (c.hasNext()) {
T value = c.next();
c.localize(pos);
// and now we do something with the position and sample value
}
myMask
has to be a RealMaskRealInterval
, not a RealMask
. This is unfortunate. We could add a Regions.sample(RealMask, RandomAccessibleInterval)
that creates a RealMaskRealInterval
matching the bounds of the given RAI. I think?myMaskedImage
cannot be used with LoopBuilder
because LoopBuilder
only supports RAI images, not II images. So we have to use this clunkier cursor code, rather than a nice lambda. ¯\_(ツ)_/¯
RealMask
(not necessarily a RealMaskRealInterval
) and a RAI and you want to combine them.
RandomAccessible
and IntervalView
, see imagej-roi-course
@NicoKiaru I have the following workflow:
Source
) and view it in BDV.AffineTransform
using the manual transform UI of BDV*.xml
file that looks exactly as the original one that I opened, but I want a new <affine>...</affine>
content, reflecting the additional transform that I manually added in BDV.Do you know how to do this most efficiently? Do I have to construct a new SpimData
object from the TransformedSource
and then use XmlIoSpimData.save()
? If so, would you have code already to construct SpimData
from a single Source
and the path to the corresponding .h5 file? Or are there other ways to save such an .xml
file?
spimData.getViewRegistrations().getViewRegistration(timePoint,iViewSetup).preconcatenateTransform(myAffineTransform);
or spimData.getViewRegistrations().getViewRegistration(timePoint,iViewSetup).concatenateTransform(myAffineTransform);
, with myAffineTransform
being the transform retrieved from the TransformedSource
. Then you can resave the dataset. FYI, I also found a trick to update the spimData
when it's shown in the bdv (thanks to reflection to access a private method see https://github.com/BIOP/bigdataviewer_scijava/blob/master/src/main/java/ch/epfl/biop/bdv/scijava/command/spimdata/UpdateSpimDataDisplay.java)
loadTimepoint
method in AbstractSpimSource
was made public, then it would be a bit easier. (https://github.com/bigdataviewer/bigdataviewer-core/blob/5be52618026c6734911d9c150a9e2ba1140799e0/src/main/java/bdv/AbstractSpimSource.java#L187)
@StephanPreibisch somehow I do not manage. It is not updating the image in BDV. Probably I am doing something wrong:
final Source< ? > source = bdv.getBdvHandle().getViewerPanel().getState().getSources().get( currentSource ).getSpimSource();
final SpimData spimData = sourceToSpimData.get( source );
spimData.getViewRegistrations().getViewRegistration( 0, 0 ).concatenateTransform( new ViewTransformAffine( "My transform", myTransfrom ) );
spimData.getViewRegistrations().getViewRegistration( 0, 0 ).updateModel();
bdv.getBdvHandle().getViewerPanel().requestRepaint();
sourceToSpimData
is a Map
that I generate while adding new SpimData
to BDV in order to keep track of things.