Login  Register

Re: AVI Reader improvement - how to submit?

Posted by Reinhard Mayr aka Czerwinski on Jun 30, 2008; 11:15am
URL: http://imagej.273.s1.nabble.com/AVI-Reader-improvement-how-to-submit-tp3695721p3695724.html

Ok, ok ... here comes the patch ;)

$ diff AVI_Reader.java AVI_Reader.java.websource
15d14
<  *  Version 2008-06-26 by Reinhard Mayr. Matrox 16bit AVIs readable.
22c21
<  *          - uncompressed 8 & 16 bit grayscale (including 16bit Matrox)
---
>  *          - uncompressed 8 & 16 bit grayscale
104d102
<     private final static int   NO_COMPRESSION_MIL= 0x204c494d; //'MIL ' - Matrox Imaging Library
275,276d272
<         else if (biBitCount == 16)
<             return new ShortProcessor(dwWidth, biHeight, (short[])pixels, cm);
549d544
<             case NO_COMPRESSION_MIL:
688d682
<         short[] sPixels = null;
692,694d685
<         } else if (biBitCount == 16) {
<             sPixels = new short[dwWidth * biHeight];
<             pixels = sPixels;
706,707d696
<             else if (biBitCount==16)
<                 unpackShort(rawData, rawOffset, sPixels, offset, dwWidth);
745,753d733
<     /** For one line: Unpack 16bit grayscale data and convert to short array for ShortProcessor */
<     void unpackShort(byte[] rawData, int rawOffset, short[] pixels, int shortOffset, int w) {
<         int  j     = shortOffset;
<         int  k     = rawOffset;
<         for (int i = 0; i < w; i++) {
<             pixels[j++] = (short) ((int)(rawData[k++] & 0xFF)| (((int)(rawData[k++] & 0xFF))<<8));
<         }
<     }
<

Base file AVI_Reader.java.websource is taken from http://rsb.info.nih.gov/ij/plugins/avi-reader.html

Wayne, I will try to send you the requested sample file (~ 30 MB) - If the size is a problem, please let me know where I can upload to.

Cheers,

Reinhard.

-------- Original-Nachricht --------
> Datum: Sun, 29 Jun 2008 10:56:19 -0400
> Von: Rasband Wayne <[hidden email]>
> An: Reinhard Mayr aka Czerwinski <[hidden email]>
> Betreff: Re: AVI Reader improvement - how to submit?

> Reinhard,
>
> > Well, well... I am new here and I must confess, I still don't  
> > entirely understand how this works in ImageJ development. I was  
> > neither able to find a source code younger than 1.39u nor a version  
> > controlled repository at all. There are just some plugin files on  
> > the web, some of them are included in the install-packages, some  
> > are not. I don't know how to uniquely refer to these files (since I  
> > am sure I worke on a specific version x). I don't understand how  
> > things on the website are updated.
>
> I am the person who updates the ImageJ website. More recent ImageJ  
> source is at <http://rsb.info.nih.gov/ij/download/src/>. The daily  
> build source is at <http://rsb.info.nih.gov/ij/source/>. There is no  
> version controlled repository for the ImageJ core but there is for  
> forks like ImageJA.
>
> > Don't get me wrong, I just don't want to dump my code (although  
> > just a few lines) into the mailing list and leave it to pure chance  
> > whether these changes are include in any future version of ImageJ  
> > or not.
>
> Send me the code with the changes clearly marked, or a patch, and I  
> will consider adding the changes to the ImageJ core. It would help if  
> you could also send, or make available, a sample 16-bit AVI.
>
> Best regards,
>
> -wayne
> >
> > Thanks for your statements convicing me of doing the right thing ! :)
> >
> > Reinhard.
> >
> > On Fri, 27 Jun 2008 13:35:48 +0200, Johannes Schindelin  
> > <[hidden email]> wrote:
> >
> >> Hi,
> >>
> >> On Thu, 26 Jun 2008, Reinhard Mayr aka Czerwinski wrote:
> >>
> >>> I just made an improvement to the AVI Reader plugin, it is now  
> >>> able to
> >>> read 16bit grayscale AVIs created with MIL (Matrox Imaging Library).
> >>>
> >>> Where can I submit the changes to in order to share this new feature
> >>> with everyone?
> >>
> >> The documentation wiki seems to be a good place
> >> (http://imagejdocu.tudor.lu/), or you can just post it
> >> to this list.
> >>
> >> Hth,
> >> Dscho
> >
> >
> >
> > --
> > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger