On Apr 13, 2012, at 5:22 AM, bateman wrote:
> Hi,
>
> Fairly new to imagej, I have made a plugin and I want to run another plugin
> from it. The plugin that I wish to run is "Query Dicom Header" which can be
> accessed here:
>
>
http://rsbweb.nih.gov/ij/plugins/query-header.html>
> If I run the Macro (using IJ.run) which is displayed on the bottom of the
> given webpage, a message appears stating that the "Image is locked".
>
> However if I record a Macro by myself where I open the plugin myself, and
> enter this macro into my plugin, the Query Dicom Header plugin runs.
>
> Where am I going wrong?
>
> I would like to use the first method mentioned such that the user does not
> have to enter the DICOM tag everytime if they want to see the same tag
> value.
You do not need to use the "Query Dicom Header" plugin. Instead, call the DicomTools.getTag() method. Here is a JavaScript example:
imp = IJ.openImage("
http://imagej.nih.gov/ij/images/ct.dcm.zip");
studyDescription = DicomTools.getTag(imp, "0008,1030");
imagePosition = DicomTools.getTag(imp, "0020,0032");
pixelSpacing = DicomTools.getTag(imp, "0028,0030");
print("Study Description: "+ studyDescription);
print("Image Position: "+imagePosition);
print("Pixel Spacing: "+ pixelSpacing);
In a macro, use the getInfo() function:
open("
http://imagej.nih.gov/ij/images/ct.dcm.zip");
studyDescription = getInfo("0008,1030");
imagePosition = getInfo("0020,0032");
pixelSpacing = getInfo("0028,0030");
print("Study Description: "+ studyDescription);
print("Image Position: "+imagePosition);
print("Pixel Spacing: "+ pixelSpacing);
-wayne