RE: [fltk.general] Re: FLTK + ITK questions [General Use]

18 views
Skip to first unread message

MacArthur, Ian (Leonardo, UK)

unread,
Aug 18, 2016, 7:51:14 AM8/18/16
to fltkg...@googlegroups.com
> I tried simple image view example and it worked (attached is the
> complete example).

The zip file was stripped away when it arrived here, so I can't comment on your code.

Did you put an executable file into the zip?

If so, please do not do that - many (all?) email filters and some firewalls will automatically strip away any zip file that contains an executable, for security reasons.

Note also that many (most?) developers will not run arbitrary binaries that are posted to mail lists, since they are very likely to be malicious!

Better just to put the source code in, then it is less likely to be stripped away by the mail filters and people have the option of building your code to see what it does for themselves, if they judge it prudent to do so.


> Where in but2 I called Run();. I get this error :
> -------------------------------------------------------------------
> [ 14%] Generating myGUI.h
> Scanning dependencies of target myGUI
> [ 28%] Building CXX object CMakeFiles/myGUI.dir/itkGUI.cxx.o
> In file included from
> /home/ibr/ZmyProjects/itk/itkGUI/src/itkGUI.cxx:2:0:
> ./myGUI.h:15:20: error: expected ‘)’ before ‘,’ token
> Fl_JPEG_Image(img, "../out.jpg");
> ^
> make[2]: *** [CMakeFiles/myGUI.dir/itkGUI.cxx.o] Error 1
> make[1]: *** [CMakeFiles/myGUI.dir/all] Error 2
> make: *** [all] Error 2
> -------------------------------------------------------------------

> Any suggestion?

Without seeing the code for myGUI.h, line 15, character position 20, it's hard to say, but it looks like you may have typed something invalid there.

It complains about:-

Fl_JPEG_Image(img, "../out.jpg");

Perhaps you meant something like:-

Fl_JPEG_Image img ("../out.jpg");

Or something.

In any case, you need to study the errors the compiler reports, and fix them, as that will surely lead you to clarity!







Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

MacArthur, Ian (Leonardo, UK)

unread,
Aug 19, 2016, 5:10:21 AM8/19/16
to fltkg...@googlegroups.com
> Hey, it is me again :D. No more error messages but I didn't get the
> result I want. The box didn't update with the resulted image.

> Here is what I did:

Setting aside for the moment what you did, it might be more pertinent to ascertain what it is you actually want to do.

For example, do you need ITK here?
It adds a lot of complexity which, for the uses you have shown, seems entirely unnecessary.

For example, fltk already has built in methods to do basic image manipulations such as de-saturating a colour image to greyscale, so for that case ITK seems like overkill.

About a decade ago I wrote this:

http://www.fltk.org/articles.php?L468

Which sounds a bit like what you are trying to do, but only uses fltk code - perhaps looking at that will give you some ideas that will help.

MacArthur, Ian (Leonardo, UK)

unread,
Aug 19, 2016, 5:15:13 AM8/19/16
to fltkg...@googlegroups.com

> 1- I noticed that the image data is included in the generated myGUI.cxx
> file, is there a way to put only a link to the image file instead then
> add it later to the binary file?

You'd probably be better off just loading the file at runtime, rather than building it into the binary.

> 2- How can use the short path e.g. ../src/myFilter.h instead of the
> complete path

Setting of file paths depends heavily on the current working directory when the file is accessed, so relative paths are more likely to be fragile and break.

But if you load the files at runtime instead, then you can set the path as best suits your application, of course.

> 3- What is the correct code to update the box with the resulted image?
> the previous code didn't work

Did you call redraw() of the widget that contains the image?
Reply all
Reply to author
Forward
0 new messages