Unrecognized Command: ''LoG 3D'' -- in IMAGEJ Macro Language - imagej

I am trying to write a code in macro language of ImageJ in order to automate manuel image analysis work. I have found another website to hande with this problem. Then, I have recently downloaded IMAGEJ v1.52q which is the latest version. Next, I pasted the code into the recorder of Marcos and I run the code. The execution caused 'Unrecognized Command':LoG 3D Error. I looked at plugin of LoG filters and I only found the one that is released in 2000. I uploaded this one into plugins part of the ImageJ, but I have got the same error. Please let me know if you have any solutions for this problem.
Thank you in advance.
The code I wrote is taken from the website: https://forum.image.sc/t/manual-image-analysis-works-but-not-the-macro-batch/134/15
and it is:
macro "Focal adhesion analysis" {
dir = getDirectory("Choose a Directory ");
list = getFileList(dir);
setBatchMode(true);
for (i=0; i<list.length; i++) {
path = dir+list[i];
open(path);
run("16-bit");
run("Subtract Background...", "rolling=50 sliding");
run("CLAHE ", "blocksize=15 histogram=256 maximum=6");
title = getTitle;
run("LoG 3D", "sigmax=4 sigmay=4");
selectWindow("LoG of "+title);
setAutoThreshold("Otsu");
run("Analyze Particles...", "size=1-Infinity circularity=0.05-1.00 clear add");
path2 = dir+File.nameWithoutExtension;
saveAs("JPEG", path2+"-bin.jpeg");
selectWindow(title);
run("Revert");
roiManager("Measure");
close();
saveAs("results", path2+"-results.tsv");
roiManager("reset");
}
}

Do you have the CLAHE and LoG 3D plugins installed? ImageJ does not come bundled with them.

Related

Aspose generated doc file turns underscores into white space for some users

I am updating archaic code that creates memos. The code was written to use bookmarks inside of manually created template.doc files that aspose can write to. The problem comes from this chunk of code.
foreach (Addressee infoAddressee in ConfigManager.GetConfig().Addressees)
{
if (infoAddressee.Abbreviation == Memo.AddresseeAbbr.ToUpper() &&
infoAddressee.NeedsThisLine)
{
WriteMeString = "FOO BARR ________";
break;
}
}
if (WriteMeString != "")
{
builder.MoveToBookmark("BOOKMARK");
builder.Write(WriteMeString);
}
}
This works for me, but the two people who have tested this chunk of code have the "FOO BARR _______" line appear as "FOO BARR "
the seven underlines are replaced with spaces(the spacing exists on the word doc, but Stack overflow concatenates consecutive spaces). I am not sure what could cause this.
To test we need to copy the file from the remote dev environment into our local environment, I believe this to be the source of the issue, but i do not know for sure.
What I have already tried:
The testers and me are supplying the exact same input for the document.
The testers and I had a slightly different way to save the document and copy paste it over to the local environment, but doing it my way did not change anything.
I am unsure of what could do this for some users but not for others, any suggestions for things i could check out, be it literature with information on the subject or proposed solutions, would be greatly appreciated
I checked the scenario on my side and cannot reproduce the problem. Underscores are properly displayed in the output document. Here are few things to try.
Try setting bookmark text instead of moving to it and writing text.
doc.Range.Bookmarks["BOOKMARK"].Text = WriteMeString;
Try checking whether string is written correctly into the document.
builder.MoveToBookmark("BOOKMARK");
builder.Write("FOO BARR ________");
Assert.AreEqual("FOO BARR ________", builder.Document.Range.Bookmarks["BOOKMARK"].Text);
using (MemoryStream ms = new MemoryStream())
{
builder.Document.Save(ms, SaveFormat.Doc);
ms.Position = 0;
Document tempDoc = new Document(ms);
Assert.AreEqual("FOO BARR ________", tempDoc.Range.Bookmarks["BOOKMARK"].Text);
}
Compare the documents produced on your side and on the testers side yourself (I suppose, you have already done this, but just in case). Probably the documents are correct, but there is difference in viewer used on your and testers side.
Disclosure: I work at Aspose.Words team.

sphinx doc with different latex versions

Recently, I found some issue with different version of tex. In our company, some are using texlive2018 and some are using texlive2017. In our conf.py, I put
latex_elements = {
'preamble': '''\usepackage{chngcntr}
\counterwithin{figure}{chapter}
\counterwithin{table}{chapter}''',
}
It runs OK in texlive2017 but have a redefined error in texlive2018. If I remove \usepackage{chngcntr}, then texlive2018 works, but texlive2017 have a undefined error. Certainly, it is triggered by some changes in newer version of texlive. But I am wondering if there is a way so that it works on both texlive version.
Indeed the macros of chngcntr have been moved to the LaTeX format with TeXLive2018.
A new version of chngcntr package starts with this
% version 1.1 this package has been adoped into the format so does not
% need to do anything in current latex releases.
\#ifundefined{counterwithout}{}{%
\PackageInfo{chngcntr}{\string\counterwithout\space already defined.\MessageBreak
Quitting chngcntr}%
\endinput
}
Thus all should be find if your TeXLive2018 has the v1.1a 2018/04/09 version of the chngctr package. Please check. Is this the Info you see? this is not an Error.
Else you can always do (beware the r else double the backslashes)
latex_elements = {
'preamble': r'''\ifdefined\counterwithout\else\usepackage{chngcntr}\fi
\counterwithin{figure}{chapter}
\counterwithin{table}{chapter}''',
}
By the way there was a related issue with the LaTeX format, but it has been fixed since.

ImageJ batch image conversion

I am trying to batch convert 200+ raw .img files using a batch script in ImageJ. My script:
//-----------Code starts here---------------------
dir1 = getDirectory("path/source");
dir2 = getDirectory("path/target");
list = getFileList(dir1);
setBatchMode(true);
for (i=0; i<list.length; i++) {
showProgress(i+1, list.length);
if(endsWith(list[i],".IMG"))
run("Raw...", open=["+dir1+list[i]+"] image=[16-bit Unsigned] width=2048 height=2048 offset=359 number=1 gap=0");
else
open(dir1+list[i]);
saveAs(format, dir2+list[i]);
close();
}
However, when I try running it I get the following error:
I am not sure why however, as I do have a ; closing the line...
The error message is misleading, because you're missing a quotation mark (") at the beginning of your second parameter to run():
run("Raw...", "open=["+dir1+list[i]+"] image=[16-bit Unsigned] width=2048 height=2048 offset=359 number=1 gap=0");
The < and > characters in the error message are indicating the position where the parser finds something unexpected.
I edited your original code to include syntax highlighting, which facilitates finding this kind of errors. Fiji's script editor includes syntax highlighting and is recommended when working with ImageJ macros.
In general, ImageJ-specific questions are more likely to be answered in time when posted on the dedicated forum: http://forum.imagej.net/

Clang_complete not worrking

unfortunately I can't manage to make clang_complete work and I could need your help.
I've already compiled vim 7.4 with python support. Here is the output of vim --version | grep python:
+cryptv +linebreak +python/dyn +viminfo
-cscope +lispindent +python3/dyn +vreplace
I followed this guide: https://vtluug.org/wiki/Clang_Complete
Please note that I've started from a clean installation (i.e. no other plugins and no further entries in my .vimrc (except for those shown in the guide above)).
According to the tutorials I've seen so far everything should be working.
However, if I try to get code completion for the following example nothing happens. If I press <c-x><x-u> I receive the error "completefunc not set".
#include <string>
int main()
{
std::string s;
s.
}
Moreover, I've installed the newest version of clang from source and it in my $PATH.
Is there a way to verify that clang_complete is actually installed?
What might cause this problem?
Any help is much appreciated.
Add
filetype plugin indent on
to your vimrc, its missing from the vimrc snippet in the link. This tells vim to do filetype detection and fire autocommands related to those file types. Without it you won't run the following autocommands.
au FileType c,cpp,objc,objcpp call <SID>ClangCompleteInit()
au FileType c.*,cpp.*,objc.*,objcpp.* call <SID>ClangCompleteInit()
Which probably initalize ClangComplete.

How to write a simple .txt content processor in XNA?

I don't really understand how Content importer/processor works in XNA.
I need to read a text file (Content/levels/level1.txt) of the form:
x x
x x
x x
where x's are just integers, into an int[,] array.
Any tips on writting a SIMPLE .txt importer??? By searching google/msdn I only found .x/.fbx file importer examples. And they seem too complicated.
Do you actually need to process the text file? If not, then you can probably skip most of the content pipeline.
Something like:
string filename = "Content/TextFiles/sometext.txt";
string path = Path.Combine(StorageContainer.TitleLocation, filename);
string lineOfText;
StreamReader sr = new StreamReader(path);
while ((lineOfText = sr.ReadLine()) != null)
{
// do something
}
Also, be sure to set the "Build Action" to "None" and the "Copy to Output Directory" to "Copy if newer" on the text files you've added. This tells the content pipeline not to compile the text file but rather copy it to the output directory for use as is.
I got this (more or less) from the RacingGame sample provided by Microsoft. It foregoes much of the content pipeline and simply loads and processes text files (XML) for much of its level data.
XNA 4.0 uses
System.IO.Stream stream = TitleContainer.OpenStream("tilename.txt");
See http://msdn.microsoft.com/en-us/library/bb199094.aspx and also http://blogs.msdn.com/b/shawnhar/archive/2010/12/09/reading-files-in-xna-game-studio-4-0.aspx
There doesn't seem to be a lot of info out there, but this blog post does indicate how you can load .txt files through code using XNA.
Hopefully this can help you get the file into memory, from there it should be straightforward to parse it in any way you like.
XNA 3.0 - Reading Text Files on the Xbox
http://www.ziggyware.com/readarticle.php?article_id=69 is probably a good place to start. It covers creating a basic content processor.

Resources