TIFF Image Support Project GSOC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

TIFF Image Support Project GSOC

Pranjali Sharma

 Hello, I'm currently in my sophomore year pursuing Btech in CSE. I'm really interested in the TIFF Image Support Project listed under the Idea List for GSOC. I want to look at the existing code for better understanding of the matter so where can I find it? Also, how do I start contributing to it.

 


 

Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

nrjank
Administrator
On Wed, Mar 24, 2021 at 8:48 AM Pranjali Sharma <[hidden email]> wrote:

 Hello, I'm currently in my sophomore year pursuing Btech in CSE. I'm really interested in the TIFF Image Support Project listed under the Idea List for GSOC. I want to look at the existing code for better understanding of the matter so where can I find it? Also, how do I start contributing to it.



Welcome! Do you have any familiarity with using Octave? In the Octave wiki under https://wiki.octave.org/Summer_of_Code_-_Getting_Started#What_you_should_know_about_Octave  there are links (admittedly poorly identified) regarding development and how to clone the source code using Mercurial. There are some links to developer guidelines as well.  We use the savannah bug tracker for discussing and submitting specific code patches, as discussed in some of those links.  Some ways to get started contributing can be finding an outstanding bug and giving it a try to find a solution.  Recommend posting a comment to an existing bug so people know you're working on it, since we don't explicitly assign bugs for people to work on.  

Let us know if you have trouble working with the code. Also, there is a discussion forum in addition to this mailing list at https://octave.discourse.group/

 
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

Nir Krakauer-3
I second everything Nicholas said, but more specifically with regard
to image support and to give you a sense of how to get started with
researching it, you can note that the project summary [1] refers to
the Octave functions imread, imwrite, and imfinfo as needing
improvement. if you search Octave's repository [2] for imread, for
example, you'll find that it is implemented as a file imread.m [3],
which calls a private function __imread__ [4] that then calls a C++
function __magick_read__ [5] that actually uses the external
GraphicsMagick library, which is what would be partly replaced with
libtiff under the proposed project.

[1] https://wiki.octave.org/Summer_of_Code_-_Getting_Started#Improve_TIFF_image_support
[2] https://hg.savannah.gnu.org/hgweb/octave/
[3] https://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/image/imread.m
[4] https://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/image/private/__imread__.m
[5] https://hg.savannah.gnu.org/hgweb/octave/file/tip/libinterp/corefcn/__magick_read__.cc

Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

Carnë Draug
In reply to this post by Pranjali Sharma
On Wed, 24 Mar 2021 at 12:48, Pranjali Sharma
<[hidden email]> wrote:
> Hello, I'm currently in my sophomore year pursuing Btech in
> CSE. I'm really interested in the TIFF Image Support Project listed
> under the Idea List for GSOC. I want to look at the existing code
> for better understanding of the matter so where can I find it? Also,
> how do I start contributing to it.

Hi

There isn't really code to start with.  The main point of this project
is to create a Matlab compatible Tiff class [1] and there isn't one in
Octave yet.  This will probably be a thin wrapper to libtiff [2].
Once that is done, it should be trivial to make imread, imwrite, and
imfinfo use it via imformats.

I'd value any contribution in C++ to Octave more than image related
contributions in the Octave language.

Best regards
David

[1] https://www.mathworks.com/help/matlab/ref/tiff.html
[2] http://www.simplesystems.org/libtiff/

Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

nrjank
Administrator
> There isn't really code to start with.  The main point of this project
> is to create a Matlab compatible Tiff class [1] and there isn't one in
> Octave yet.  

I'm sure we note this somewhere in the Developer guidelines, but probably worth a reminder when working on creating Matlab compatible code:  Please limit your inspection of Matlab function requirements to publicly accessible documentation.  Examining Matlab interpreter/graphical output from test scripts is acceptable for comparison (and focused requests for this can be made to the group if you do not have matlab access.) But even if you have legal access to the software, at no point during development should you even look at any of the underlying Matlab function code. Doing so can render your contributions completely unusable by Octave.

@David - are there any similar existing wrappers/class implementations worth pointing out in particular as a reference?
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

Pranjali Sharma
I've been researching about TIFF and libtiff and I'm all set to work on the tiff class. I've got the basic idea but need some time to think about it. Thank you all for the wonderful assistance!

On Wed, Mar 24, 2021 at 11:30 PM Nicholas Jankowski <[hidden email]> wrote:
> There isn't really code to start with.  The main point of this project
> is to create a Matlab compatible Tiff class [1] and there isn't one in
> Octave yet.  

I'm sure we note this somewhere in the Developer guidelines, but probably worth a reminder when working on creating Matlab compatible code:  Please limit your inspection of Matlab function requirements to publicly accessible documentation.  Examining Matlab interpreter/graphical output from test scripts is acceptable for comparison (and focused requests for this can be made to the group if you do not have matlab access.) But even if you have legal access to the software, at no point during development should you even look at any of the underlying Matlab function code. Doing so can render your contributions completely unusable by Octave.

@David - are there any similar existing wrappers/class implementations worth pointing out in particular as a reference?
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

Carnë Draug
On Wed, Mar 24, 2021 at 11:30 PM Nicholas Jankowski <[hidden email]> wrote:
> [...]
> @David - are there any similar existing wrappers/class
> implementations worth pointing out in particular as a reference?

Not really.  The closest thing is the @ftp class which uses the old
style classes.  Its methods are pretty much single lines that simply
call the corresponding __dunder__ method.

Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

nrjank
Administrator
On Thu, Mar 25, 2021 at 1:02 PM Carnë Draug <[hidden email]> wrote:
>
> On Wed, Mar 24, 2021 at 11:30 PM Nicholas Jankowski <[hidden email]> wrote:
> > [...]
> > @David - are there any similar existing wrappers/class
> > implementations worth pointing out in particular as a reference?
>
> Not really.  The closest thing is the @ftp class which uses the old
> style classes.  Its methods are pretty much single lines that simply
> call the corresponding __dunder__ method.

At the risk of getting off topic here, based on the Projects [1] and classdef [2] wiki pages, is the status of newer style classdef classes such that the old style should be completely avoided? Asking because I was looking at an old simple bug [3] with a patch in the old class style and I was debating bringing it up to date including redoing it as a 'new style' class as a way to start learning about such things.

[1] https://wiki.octave.org/wiki/index.php?title=Projects&mobileaction=toggle_view_mobile#Implement_classdef_classes
[2] https://wiki.octave.org/Classdef
[3] https://savannah.gnu.org/bugs/?35821
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

mmuetzel
In reply to this post by Carnë Draug
Am 25. März 2021 um 19:01 Uhr schrieb "Carnë Draug":
> On Wed, Mar 24, 2021 at 11:30 PM Nicholas Jankowski <[hidden email]> wrote:
> > [...]
> > @David - are there any similar existing wrappers/class
> > implementations worth pointing out in particular as a reference?
>
> Not really.  The closest thing is the @ftp class which uses the old
> style classes.  Its methods are pretty much single lines that simply
> call the corresponding __dunder__ method.

A few months back I started implementing a classdef wrapper for RapidXML that also follows a similar approach as the old-style @ftp class.
See: https://savannah.gnu.org/bugs/index.php?59245

I don't remember in which state it currently is. But I believe it was working more or less.
That implementation also aimed to achieve some compatibility with Matlab's XML interface. IIUC, that isn't an issue for this project because the libtiff wrapper would be internal to Octave.

I wouldn't claim that it is a "reference" implementation. Feedback is very welcome!
But hopefully some parts of it might help getting started with a libtiff wrapper.

Markus


Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

Carnë Draug
On Sun, 28 Mar 2021 at 12:00, Markus Mützel <[hidden email]> wrote:

> Am 25. März 2021 um 19:01 Uhr schrieb "Carnë Draug":
> > On Wed, Mar 24, 2021 at 11:30 PM Nicholas Jankowski <[hidden email]> wrote:
> > > [...]
> > > @David - are there any similar existing wrappers/class
> > > implementations worth pointing out in particular as a reference?
> >
> > Not really.  The closest thing is the @ftp class which uses the old
> > style classes.  Its methods are pretty much single lines that simply
> > call the corresponding __dunder__ method.
>
> A few months back I started implementing a classdef wrapper for
> RapidXML that also follows a similar approach as the old-style @ftp
> class.
> See: https://savannah.gnu.org/bugs/index.php?59245
>
> I don't remember in which state it currently is. But I believe it
> was working more or less.  That implementation also aimed to achieve
> some compatibility with Matlab's XML interface. IIUC, that isn't an
> issue for this project because the libtiff wrapper would be internal
> to Octave.

Actually, the libtiff wrapper is supposed to implement the Tiff class
which exists in Matlab and is missing in Octave.  So yeah, Matlab
compatibility is required.  Having imread/imwrite/imfinfo make use
that Tiff class is something to do after.

This whole having multiple __dunder__ functions which are then called
from almost single line m files seems a bit silly.  I think it would
be cleaner to do it all in C++.  Is there a way to add a class to
Octave from an oct file only?

Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

mmuetzel
Am 29. März 2021 um 01:27 Uhr schrieb "Carnë Draug":

> On Sun, 28 Mar 2021 at 12:00, Markus Mützel <[hidden email]> wrote:
> > Am 25. März 2021 um 19:01 Uhr schrieb "Carnë Draug":
> > > On Wed, Mar 24, 2021 at 11:30 PM Nicholas Jankowski <[hidden email]> wrote:
> > > > [...]
> > > > @David - are there any similar existing wrappers/class
> > > > implementations worth pointing out in particular as a reference?
> > >
> > > Not really.  The closest thing is the @ftp class which uses the old
> > > style classes.  Its methods are pretty much single lines that simply
> > > call the corresponding __dunder__ method.
> >
> > A few months back I started implementing a classdef wrapper for
> > RapidXML that also follows a similar approach as the old-style @ftp
> > class.
> > See: https://savannah.gnu.org/bugs/index.php?59245
> >
> > I don't remember in which state it currently is. But I believe it
> > was working more or less.  That implementation also aimed to achieve
> > some compatibility with Matlab's XML interface. IIUC, that isn't an
> > issue for this project because the libtiff wrapper would be internal
> > to Octave.
>
> Actually, the libtiff wrapper is supposed to implement the Tiff class
> which exists in Matlab and is missing in Octave.  So yeah, Matlab
> compatibility is required.  Having imread/imwrite/imfinfo make use
> that Tiff class is something to do after.

Thanks for clarifying. I didn't read that correctly before.

> This whole having multiple __dunder__ functions which are then called
> from almost single line m files seems a bit silly.  I think it would
> be cleaner to do it all in C++.  Is there a way to add a class to
> Octave from an oct file only?

If you want to have something that looks a lot like a class from a user perspective, you could overload the "subsref" method of a octave_base_value class. You could use that subsref function to dispatch to the "actual" methods (see e.g. the octave_java class in libinterp/octave-value/ov-java.h and .cc).
But IIUC, you won't have all of the classdef features with that approach (like access restrictions, inheritance(?), ...).
I don't know if it is possible to implement a full-featured classdef class just in C++ code. (I would be interested as well if someone could show how to do that.)

Markus


Reply | Threaded
Open this post in threaded view
|

Re: TIFF Image Support Project GSOC

John W. Eaton
Administrator
In reply to this post by Carnë Draug
On 3/28/21 7:27 PM, Carnë Draug wrote:

> This whole having multiple __dunder__ functions which are then called
> from almost single line m files seems a bit silly.  I think it would
> be cleaner to do it all in C++.  Is there a way to add a class to
> Octave from an oct file only?

Since a classdef object is just a special type of octave_value object
internally, then yes, it should definitely be possible to define a
built-in classdef class but as far as I know, we don't currently have
any examples for how to do it.  As the tiff object is not the only one
that we will likely want to define this way, we should probably try to
define an interface that makes this job easy.

jwe