ImageJ classes used to analyze - java

I'm developing a ImageJ plugin that It works in my desktop pc but in my laptop it doesn't.
For this reason, now I'm trying to improve and I want to modify the next steps but i can't get it. This is the code:
IJ.selectWindow("example");
IJ.run("Convert to Mask");
IJ.run("Fill Holes");
IJ.run("Set Scale...", "distance=1 known="+pixelSize+" pixel=1 unit=um");
IJ.run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Masks display clear record");
I known that "Analyze Particles" I must to use the ParticleAnalyzer class (I dont sure how to do but... I'm researching the class) but for the other steps I can not find solution.
I hope that someone can help, thank you.
Best Regards.

I didn't get what I wanted it but I left to use the windows and now I am using ImagePus variables and It works better. I put the code:
IJ.run(this.cMask, "Convert to Mask", "");
IJ.run(this.cMask, "Fill Holes","");
IJ.run(this.cMask, "Set Scale...", "distance=1 known="+pixelSize+" pixel=1 unit=um");
IJ.run(this.cMask, "Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 display clear record");

Related

How can I acces description of JFXTextField?

I need to see the description of the JFoenix component JFXTextField.
This should usually be possible with CTRL + clicking on "JFXTextField" somewhere in the code.
In this video it works, see 3:20
https://www.youtube.com/watch?v=MU0MCdk3i7s.
However when I do this, this is what I get:
class description
I don't know what's the cause of this so can anybody tell me how I get access to this description?
Thank you!!

Android Studio - URL string

So I'm pretty new to the whole Android Studio thing and I've been using the internet to help me with a lot of the things I am doing and needed help on something.
I'm not sure if it's possible to connect this to either a string or an SQL database but I have a Main Layouts with a bunch of buttons that allow me to click on them and choose what external player I would like to use to watch the video. In my MainActivity java class, this is how it finds the button.
case R.id.button3:
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("http://videoname.mp4"), "video/*");
startActivity(Intent.createChooser(intent, "Choose an External Player"));
break;"
I wanted to know if "http://videoname.mp4" url can be connected to like a string where I can always update or change the URL instead of manually going to find the URL in the MainActivity java and changing it. As of now I have to manually do it but a different way to do it would be helpful.
I'm sorry if it's all confusing, but if you know, please let me know as soon as.
Thank you.
you just need write your string URL :
open your directory folder /res/values/strings.xml -> write your string : <string name="yourStringName>yourStringURL</string>. to use your string do this
getContext().getString(R.string.yourStringName) in fragment
getString(R.string.yourStringName) in Activity
or you can write directly on your code, put your cursor on your string, then press key alt + enter choose extract string resource fill the resource name with your string name
wherever you need to use it, just do point 1 or 2. also in your Intent
hope this help you, never stop learning!
Add it to strings.xml in your project. That is the recommended way of using strings anyway.

UISpec4J File Chooser Testing

I'm trying to use UISpec4J to test a file chooser.
A button is supposed to make the file chooser pop up. I found an example for a file chooser that pops up from a menu option:
WindowInterceptor
.run(openMenu.triggerClick())
.process(FileChooserHandler.init()
.titleEquals("Select a template file")
.assertAcceptsFilesOnly()
.select("/home/bond/file.txt"))
.run();
But I can't seem to get it to work with a simple button click instead - I know this is probably a really simple question but I can't seem to find other documentation to get this to work and I am pretty stuck... Can someone explain how to test this? Thanks!
I've also tried example from documentation and failed. Little change could help:
WindowInterceptor
.init(openMenu.triggerClick())
.process(FileChooserHandler.init()
.titleEquals("Select a template file")
.assertAcceptsFilesOnly()
.select("/home/bond/file.txt"))
.run();
I've replaced first instance of run to init.
Probably, it's a typo in docs.

How to link the URL in Robo Help using Java?

I have an application which has lots of UI screens.Each screen will have 'help' button.
When I press help button ,It should link with corresponding help file(Created hel file by robohelp).
for example:
I have created robo help file..in tat, the file will have the user manual for whole related application with different topic.So when I click help button,It should link to corressponding topic in tat file.how to link the same file but diiferent topics for the corresponding screens.
Plz anyone knws the idea,help me?
Please note that RoboHelp creates many different output formats that may be used as the help system. If you are creating WebHelp, take a look at the link below:
http://wvanweelden.eu/robohelp/context_sensitivity_in_webhelp
If you are creating CHM, the process will be similar.
Cheers... Rick :)

Open and maximise a browser window in OATS Java (not javascript)

I am a tester and just installed oracle application test suite to use testing eBus apps
Anyway the only language it supports for coding test scripts (I don't want to use the recorder for a number of reasons). The problem I am having is that everything I search or google is javascript not java (even googling with -script I still ended up looking at javascript. This just gets rejected by the oats editor
The only other examples I have seen, appear to be defining a variable then setting the value of that variable as the window they want to maximize. Aside from the fact that my java skills are not up to doing that - I do not need to do this for a newly opened browser window do I? (The assumption is that this will be the only browser window open (ie test is executed with browser closed)
Is there any easy way to do this?
Below is the very simple initiate of the browser which is generated from a recording plus part of the first step which loads the url the test starts at: (I realize the first step is not complete below -I didn't paste it all, just enough to hopefully allow someone to show me what I need to edit to force the browser to load maximized, or maximize it immediately after loading?
public void initialize() throws Exception {
browser.launch();
}
/**
* Add code to be executed each iteration for this virtual user.
*/
public void run() throws Exception {
beginStep("[1] Login (/RF.jsp)", 0);
{
web
.window(2,
"/web:window[#index='0' or #title='about:blank']")
.navigate(
"http://somepageiwantolaunch");
web.window(4, "/web:window[#index='0' or #title='Login']")
.waitForPage(null);
I am not sure whether you already got the answer for this.. if not this code should help you
browser.launch();
DOMBrowser currentExecutionBrowser = web.window("/web:window[#index='0' or #index='1']");
currentExecutionBrowser.maximize();
Let me know if this helps!
There is a function in the Oracle Functional Tester API Reference which has a build in function called object.WindowState It says you can get or set using this function and it has values
0 - Normal, 1- minimized and 2-maximised.
Only issue is that these examples look more like VB than Javascript but presumably there is a similar function built into to the Oracle libraries for Java.
I did a quick search for Oracle Openscript API and came up with this link which asks for the same thing. They suggest using Help->Search from within the openscript application and then searching for "openscript API" which should provide a list of the functions available.
Hope that helps.
To Maximize browser in OATS, follow the below code
Open script ha in built methods which helps coding easy
browser.launch();
web.window(12, "/web:window[#index='0' or #title='about:blank']").navigate("http://www.google.com/");
web.window(12, "/web:window[#index='0' or #title='about:blank']").maximize();
for more OATS Tips/Tricks follow here
http://www.testinghive.com/category/oracle-application-testing-suite-tips
If it is the only browser window open, you can use the below code. It must be used with caution since the code maximizes any window that is open above the browser window.
try {
Robot a = new Robot();
a.keyPress(KeyEvent.VK_ALT);
a.keyPress(KeyEvent.VK_SPACE);
a.keyRelease(KeyEvent.VK_SPACE);
a.keyRelease(KeyEvent.VK_ALT);
a.keyPress(KeyEvent.VK_X);
a.keyRelease(KeyEvent.VK_X);
} catch (AWTException e) {
}

Categories