Thursday, 8 May 2014

ImageJ2


ImageJ2 is a new version of ImageJ seeking to strengthen both the software and its community. Internally, it is a total redesign of ImageJ, but it is backwards compatible with ImageJ 1.x via a "legacy layer" and features a user interface closely modeled after the original.

Under the hood, ImageJ2 completely isolates the image processing logic from the graphical user interface (UI), allowing ImageJ2 commands to be used in many contexts, including headless in the cloud or on a server such as OMERO, or from within another application such as KNIME, Icy or CellProfiler (a Python application).

ImageJ2 has an N-dimensional data model driven by the powerful ImgLib2 library, which supports image data expressed in an extensible set of numeric and non-numeric types, and accessed from an extensible set of data sources. ImageJ2 is driven by a state-of-the-art, collaborative development process, including version control, unit testing, automated builds via a continuous integration system, a bug tracker and more.

We are collaborating closely with related projects including Fiji, SCIFIO and OME, and are striving to deliver a coherent software stack reusable throughout the life sciences community and beyond. For more details, see the SciJava web site.

ImageJ2 is currently in the "beta" stage, meaning the code is not finished. It is being released for early community feedback and testing. Comments, questions and bug reports are much appreciated!

To maintain ImageJ's continuity of development, we have modeled the application after ImageJ v1.x as much as is reasonable. However, please be aware that ImageJ2 is essentially a total rewrite of ImageJ from the ground up. It provides backward compatibility with older versions of ImageJ by bundling the latest v1.x code and translating between "legacy" and "modern" image structures.

For more details on the project, see the ImageJ2 web site.

LICENSING

ImageJ2 is distributed under a Simplified BSD License; for the full text of the license, see LICENSE.txt.
For the list of developers and contributors, see pom.xml.

IMAGEJ AS A LIBRARY

This repository is the master ImageJ2 application, which brings together all of ImageJ under the artifact net.imagej:imagej. It is the easiest entry point if you are looking to use ImageJ as a library from your own software. E.g., in your Maven pom.xml:

<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>2.0</version>
</parent>
...
<dependency>
<groupId>net.imagej</groupId>
<artifactId>imagej</artifactId>
</dependency>
We recommend inheriting from the pom-scijava parent, although it is not required. (If you do not, you will need to include the <version> of ImageJ in your <dependency> declaration.)

DEPENDENCIES

This component depends on other, lower level components, each of which lives in its own repository:
It also includes uses various "plugin" components at runtime:
See the pom.xml for a complete list of dependencies.

BUGS

For a list of known issues, see the issue tracking system.
Please report any bugs by following the instructions online.

Wednesday, 7 May 2014

Version 1.48v 19 April 2014 (upgrade)

  •  Plot and Histogram windows are no longer centered on the screen.
  • Added the Overlay.clear and setOption("Add to overlay",boolean) macro functions.
  • Thanks to David Knecht, commands listed in the Plugins>Shortcuts>List Shortcuts and Plugins>Shortcuts>Create Shortcutdialogs are sorted with case ignored.
  • Thanks to Denis Roussel, changed an incorrect Javadoc reference in PlugInFilter.java from SUPPORTS_STACKS to DOES_STACKS.
  • Thanks to Johannes Schindelin, added @link tags to the PlugInFilter.java Javadocs.
  • Fixed a bug that caused the progress bar to not terminate after dragging a jar file to the "ImageJ" window.
  • Fixed a bug that caused the roiManager("add") macro function to unexpectedly set the stack position of the source selection. 

ImageJ Features

Runs Everywhere:
ImageJ is written in Java, which allows it to run on Linux, Mac OS X and Windows, in both 32-bit and 64-bit modes.
Open Source:
ImageJ and its Java source code are freely available and in the public domain. No license is required.
User Community:
ImageJ has a large and knowledgeable worldwide user community. More than 1700 users and developers subscribe to the ImageJ mailing list.
Macros:
Automate tasks and create custom tools using macros. Generate macro code using the command recorder and debug it using the macro debugger. More than 300 macros are available on the ImageJ Web site.
Plugins:
Extend ImageJ by developing plugins using ImageJ's built in text editor and Java compiler. More than 500 plugins are available.
Toolkit:
Use ImageJ as a image processing toolkit (class library) to develop applets, servlets or applications.
Speed:
ImageJ is the world's fastest pure Java image processing program. It can filter a 2048x2048 image in 0.1 seconds (*). That's 40 million pixels per second!
Data Types:
8-bit grayscale or indexed color, 16-bit unsigned integer, 32-bit floating-point and RGB color.
File Formats:
Open and save all supported data types as TIFF (uncompressed) or as raw data. Open and save GIF, JPEG, BMP, PNG, PGM, FITS and ASCII. Open DICOM. Open TIFFs, GIFs, JPEGs, DICOMs and raw data using a URL. Open and save many other formats using plugins.
Image display:
Tools are provided for zooming (1:32 to 32:1) and scrolling images. All analysis and processing functions work at any magnification factor.
Selections:
Create rectangular, elliptical or irregular area selections. Create line and point selections. Edit selections and automatically create them using the wand tool. Draw, fill, clear, filter or measure selections. Save selections and transfer them to other images.
Image Enhancement:
Supports smoothing, sharpening, edge detection, median filtering and thresholding on both 8-bit grayscale and RGB color images. Interactively adjust brightness and contrast of 8, 16 and 32-bit images.
Geometric Operations:
Crop, scale, resize and rotate. Flip vertically or horizontally.
Analysis:
Measure area, mean, standard deviation, min and max of selection or entire image. Measure lengths and angles. Use real world measurement units such as millimeters. Calibrate using density standards. Generate histograms and profile plots.
Editing:
Cut, copy or paste images or selections. Paste using AND, OR, XOR or "Blend" modes. Add text, arrows, rectangles, ellipses or polygons to images.
Color Processing:
Split a 32-bit color image into RGB or HSV components. Merge 8-bit components into a color image. Convert an RGB image to 8-bit indexed color. Apply pseudo-color palettes to grayscale images.
Stacks:
Display a "stack" of related images in a single window. Process an entire stack using a single command. Open a folder of images as a stack. Save stacks as multi-image TIFF files.    

Intro to ImageJ

ImageJ is free public domain image processing software developed at the National Institutes of Health. Its power and flexibility allow it to be used as a research tool by scientists in many disciplines, from medicine to astronomy. Installers are available for Windows, MacOS and OSX, and Linux.
You can use ImageJ to display, annotate, edit, calibrate, measure, analyze, process, print, and save raster (row and column) image data. It reads most common raster image formats as well as raw data files in text format, such as from spreadsheets. ImageJ also supports stacks - multiple images in a single window - for animation and analysis.

ImageJ is a public domain Java image processing program inspired by NIH Image for the Macintosh. It runs, either as an online applet or as a downloadable application, on any computer with a Java 1.4 or later virtual machine. Downloadable distributions are availablefor Windows, Mac OS, Mac OS X and Linux.

It can display, edit, analyze, process, save and print 8-bit, 16-bit and 32-bit images. It can read many image formats including TIFF, GIF, JPEG, BMP, DICOM, FITS and "raw". It supports "stacks", a series of images that share a single window. It is multithreaded, so time-consuming operations such as image file reading can be performed in parallel with other operations.

It can calculate area and pixel value statistics of user-defined selections. It can measure distances and angles. It can create density histograms and line profile plots. It supports standard image processing functions such as contrast manipulation, sharpening, smoothing, edge detection and median filtering.

It does geometric transformations such as scaling, rotation and flips. Image can be zoomed up to 32:1 and down to 1:32. All analysis and processing functions are available at any magnification factor. The program supports any number of windows (images) simultaneously, limited only by available memory.

Spatial calibration is available to provide real world dimensional measurements in units such as millimeters. Density or gray scale calibration is also available.

ImageJ was designed with an open architecture that provides extensibility via Java plugins. Custom acquisition, analysis and processing plugins can be developed using ImageJ's built in editor and Java compiler. User-written plugins make it possible to solve almost any image processing or analysis problem. 

Friday, 25 April 2014

Rotate Cross Lines With help Of Circle


                             

                                double radians = Math.atan2(event.getY() - osPoint.getCenterY(), event.getX()
- osPoint.getCenterX());

double degrees = Math.round((radians * 180 / Math.PI));

double rotation = degrees + 90;

osPoint.setRotate(osPoint.getRotate() + rotation);
osHline.setRotate(osHline.getRotate() + rotation);
osVline.setRotate(osVline.getRotate() + rotation);

Tuesday, 15 April 2014

java replaceFirst problem with $

Not here, it isn't. When calling replaceFirst() or replaceAll(), the first argument is a regular expression, which follows the rules of java regular expressions as described in java.util.regex.Pattern. But the second argument is not a regex; it's a replacement text - which has different rules. Quoting from the String.replaceFirst() API: "Note that backslashes (\) and dollar signs ($) in the replacement string may cause the results to be different than if it were being treated as a literal replacement string; see Matcher.replaceFirst(java.lang.String). Use Matcher.quoteReplacement(java.lang.String) to suppress the special meaning of these characters, if desired."

If you follow the link to Matcher.replaceFirst() it refers you to Matcher.appendReplacement() which has more detail: "The replacement string may contain references to subsequences captured during the previous match: Each occurrence of $g will be replaced by the result of evaluating group(g). The first number after the $ is always treated as part of the group reference. Subsequent numbers are incorporated into g if they would form a legal group reference. Only the numerals '0' through '9' are considered as potential components of the group reference. If the second group matched the string "foo", for example, then passing the replacement string "$2bar" would cause "foobar" to be appended to the string buffer. A dollar sign ($) may be included as a literal in the replacement string by preceding it with a backslash (\$)."

In other words, $1 would be capture group 1, $6 would be capture group 6. $z doesn't make sense to the matcher - that's what "Illegal group reference" means here. Because z is not a group.

And to fix this problem, you can either do as EFJ showed, putting a double backslash in front of the $, or you can use Matcher.quoteReplacement() as suggested in the replaceFirst() API:

String y = Matcher.quoteReplacement("xy$z");


Now What we do in this case : String x ="${data} m,.m,.m,";

So the solution is :


        String x ="${data} m,.m,.m,";
        String y = x.replaceFirst("\\$\\{data\\}", "Amaan");
        System.out.println(y);