Skip to content

Commit

Permalink
2018.07.12 (1.52f2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Jul 13, 2018
1 parent 3117bcd commit 3b64d27
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ij/ImageJ.java
Expand Up @@ -79,7 +79,7 @@ public class ImageJ extends Frame implements ActionListener,

/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
public static final String VERSION = "1.52f";
public static final String BUILD = "1";
public static final String BUILD = "2";
public static Color backgroundColor = new Color(237,237,237);
/** SansSerif, 12-point, plain font. */
public static final Font SansSerif12 = new Font("SansSerif", Font.PLAIN, 12);
Expand Down
22 changes: 17 additions & 5 deletions ij/plugin/FolderOpener.java
Expand Up @@ -21,6 +21,7 @@ public class FolderOpener implements PlugIn {
private static boolean staticOpenAsVirtualStack;
private boolean convertToRGB;
private boolean sortFileNames = true;
private boolean sortByMetaData = true;
private boolean openAsVirtualStack;
private double scale = 100.0;
private int n, start, increment;
Expand All @@ -40,15 +41,21 @@ public static ImagePlus open(String path) {

/** Opens the images in the specified directory as a stack. Opens
the images as a virtual stack if the 'options' string contains
"virtual" or "use". Add " file=abc" to 'options' to only open
images with, for example, "abc" in their name. Displays directory
chooser and options dialogs if the the 'path' argument is null. */
'virtual' or 'use'. Add ' file=abc' to the options string to only open
images with, for example, 'abc' in their name. Add ' noMetaSort' to
disable sorting of DICOM stacks by series number (0020,0011).
Displays directory chooser and options dialogs if the the 'path'
argument is null. */
public static ImagePlus open(String path, String options) {
if (options==null)
options = "";
FolderOpener fo = new FolderOpener();
fo.saveImage = true;
fo.openAsVirtualStack = options!=null && (options.contains("virtual")||options.contains("use"));
if (options!=null) {
fo.openAsVirtualStack = options.contains("virtual") || options.contains("use");
if (options.contains("noMetaSort"))
fo.sortByMetaData = false;
}
fo.filter = Macro.getValue(options, "file", "");
fo.run(path);
return fo.image;
Expand Down Expand Up @@ -331,7 +338,8 @@ else if (label2!=null && !label2.equals(""))
imp2.setCalibration(cal);
}
if (info1!=null && info1.lastIndexOf("7FE0,0010")>0) {
stack = DicomTools.sort(stack);
if (sortByMetaData)
stack = DicomTools.sort(stack);
imp2.setStack(stack);
double voxelDepth = DicomTools.getVoxelDepth(stack);
if (voxelDepth>0.0) {
Expand Down Expand Up @@ -533,6 +541,10 @@ public void sortFileNames(boolean b) {
sortFileNames = b;
}

public void sortByMetaData(boolean b) {
sortByMetaData = b;
}

/** Sorts file names containing numerical components.
* @see ij.util.StringSorter#sortNumerically
* Author: Norbert Vischer
Expand Down
2 changes: 1 addition & 1 deletion ij/plugin/frame/RoiManager.java
Expand Up @@ -433,7 +433,7 @@ String getHex(Color color) {
* be used to form the first part of the ROI label if it is zero or greater.
* @param imp the image associated with the ROI, or null
* @param roi the Roi to be added
* @param n if zero or greater, will be used to form irst part of the label
* @param n if zero or greater, will be used to form the first part of the label
*/
public void add(ImagePlus imp, Roi roi, int n) {
if (IJ.debugMode && n<3 && roi!=null) IJ.log("RoiManager.add: "+n+" "+roi.getName());
Expand Down
7 changes: 5 additions & 2 deletions release-notes.html
Expand Up @@ -5,10 +5,13 @@
</head>
<body>

<li> <u>1.52e 11 July 2018</u>
<li> <u>1.52f 12 July 2018</u>
<ul>
<li> Thanks to 'Sethur', added a 'noMetaSort' option to the options
string of the FolderOpener.open(dir,options) method. This option
disables sorting of DICOM stacks by series number (0020,0011).
<li> Thanks to Christian Tischer, fixed bugs in the RoiManager.add(ImagePlus,Roi,int)
method than caused it to not behave as expected.
method than caused it to not behave as expected if the ROI name was not null.
</ul>

<li> <u>1.52e 11 July 2018</u>
Expand Down

0 comments on commit 3b64d27

Please sign in to comment.