Skip to content

Commit 01da097

Browse files
committed
Fix javadocs and images being displayed on some headless scripts
1 parent 8417302 commit 01da097

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎src/main/java/sc/fiji/snt/SNT.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,19 @@ public String toString() {
335335
* Script-friendly constructor for Instantiating and initializing SNT in
336336
* 'Tracing Mode' (typically headless operations). The channel/frame to
337337
* be traced is assumed to be the image's active CT position.
338+
* <p>
339+
* Note that the image is not displayed. For interactive display of the image call
340+
* {@link #initialize(ImagePlus)}/{@link #startUI()} directly.
341+
* </p>
338342
*
339343
* @param sourceImage the source image
340344
* @throws IllegalArgumentException If sourceImage is of type 'RGB'
341345
*/
342346
public SNT(final ImagePlus sourceImage) throws IllegalArgumentException {
343347
this(SNTUtils.getContext(), sourceImage);
344-
initialize(true, sourceImage.getChannel(), sourceImage.getFrame());
348+
// NB: Previous versions called: initialize(true, sourceImage.getChannel(), sourceImage.getFrame());
349+
// which caused the image to be displayed even in non-interactive scripts. This call was removed
350+
// for consistency: callers wanting full UI should use startUI() or initialize(imp) explicitly
345351
}
346352

347353
/**

‎src/main/java/sc/fiji/snt/SNTPrefs.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ public static void setLastKnownDir(final File file) {
649649

650650
/**
651651
* Returns the list of filename suffixes used to identify images when navigating
652-
* to the next/previous image in a folder (see {@link SNTUI). Matching is
652+
* to the next/previous image in a folder (see {@link SNTUI}). Matching is
653653
* case-insensitive and applied to the end of the filename (i.e., {@code endsWith}).
654654
* Suffixes may include a leading dot (e.g., {@code ".tif"}) or a partial filename
655655
* suffix (e.g., {@code "_max.tif"}).

‎src/main/java/sc/fiji/snt/util/ImgUtils.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,14 +1272,12 @@ public static void save(final RandomAccessibleInterval<? extends RealType<?>> im
12721272
* values to the target type's range automatically (e.g. 16-bit unsigned
12731273
* values are clamped to [0, 65535]).
12741274
* </p>
1275-
* <p>
12761275
* Typical usage:
12771276
* <pre>
12781277
* ImgUtils.save(rai, "/path/to/out.tif", new UnsignedShortType());
12791278
* ImgUtils.save(rai, "/path/to/out.tif", new UnsignedByteType());
12801279
* ImgUtils.save(rai, "/path/to/out.tif", new FloatType());
12811280
* </pre>
1282-
* </p>
12831281
*
12841282
* @param <T> the output pixel type; must be a {@link NativeType} so
12851283
* that an {@link ArrayImgFactory} can allocate it
@@ -1440,13 +1438,13 @@ public static String axisReport(final ImgPlus<?> img) {
14401438
* Returns a new {@link ImgPlus} with two axes swapped. The underlying data
14411439
* is a lazy permuted view (no pixel data is copied). Axis metadata (type,
14421440
* scale, unit) is reordered to match the new dimension order.
1443-
* <p>
14441441
* Example: swap Z and Channel in an XYZCT image:
14451442
* <pre>
1443+
* {@code
14461444
* ImgPlus<?> xyzct = ImgUtils.open("image.tif");
14471445
* ImgPlus<?> xyczT = ImgUtils.swapAxes(xyzct, Axes.Z, Axes.CHANNEL);
1446+
* }
14481447
* </pre>
1449-
* </p>
14501448
*
14511449
* @param <T> the pixel type
14521450
* @param img the source image

‎src/main/java/sc/fiji/snt/viewer/Bvv.java‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,11 @@ public void setChannelColors(final String... colorNames) {
347347
* Sets per-channel colors for a specific source group. Each color is applied
348348
* to the corresponding channel in order; extra colors are ignored, and channels
349349
* without a supplied color are left unchanged.
350-
* <p>
351-
* Typical Groovy/PySNT usage:
350+
* Typical script usage:
352351
* <pre>
353352
* def bvv = Bvv.open([reference, moving])
354353
* bvv.setChannelColors(bvv.getMultiSources().get(0), Color.RED, Color.GREEN, Color.BLUE)
355354
* </pre>
356-
* </p>
357355
*
358356
* @param group the target source group, obtained from {@link #getMultiSources()}
359357
* @param colors one color per channel, in channel order
@@ -383,13 +381,11 @@ private void applyChannelColors(final BvvMultiSource group, final Color... color
383381
* To apply the same color pattern to every group independently, call
384382
* {@link #setChannelColors(BvvMultiSource, Color...)} per group.
385383
* </p>
386-
* <p>
387-
* Typical Groovy/PySNT usage:
384+
* Typical script usage:
388385
* <pre>
389386
* def bvv = Bvv.open(img)
390387
* bvv.setChannelColors(Color.RED, Color.GREEN, Color.BLUE)
391388
* </pre>
392-
* </p>
393389
*
394390
* @param colors colors assigned sequentially across all channels in all groups
395391
*/
@@ -594,14 +590,14 @@ public static Bvv open(final SNT snt) {
594590
* <p>
595591
* The caller is responsible for constructing the {@link AbstractSpimData}
596592
* object, typically via an XML/HDF5 loader:
593+
* </p>
597594
* <pre>
598595
* import bdv.spimdata.XmlIoSpimDataMinimal
599596
* spimData = new XmlIoSpimDataMinimal().load("/path/to/dataset.xml")
600597
* def bvv = Bvv.open(spimData)
601598
* </pre>
602599
* or via Bio-Formats/IMS loaders that produce a {@link AbstractSpimData} with
603600
* a multiresolution pyramid.
604-
* </p>
605601
*
606602
* @param spimData the dataset to display
607603
* @return the fully initialised {@link Bvv} instance

0 commit comments

Comments
 (0)