[ome-users] Compile BF-ITK-pipe on Windows

Joe Ping-Lin Hsiao phsiao at cs.unc.edu
Fri Apr 27 16:47:30 BST 2012


Curtis,

I modified bf-itk-pipe source so that it compiles and works on Windows
7 64bit. What I did was replacing Linux system calls to the ones that
work on Windows and fixing the code which depends on new line
characters  (Windows  uses '\r\n' instead of just '\n').

All I changed is just one file: itkBioFormatsImageIO.cxx, and I have
attached the modified version. Search for '#ifdef WIN32' to see what
the modifications are.

Thanks,
Joe

On Mon, Apr 16, 2012 at 1:25 PM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu> wrote:
> Hi Curtis,
>
>> While we have not seen such compile errors per se, Windows support is
>> definitely the least well tested. We have historically had a lot of
>> difficulty getting the Bio-Formats ITK plugin (all three iterations of it,
>> not just the pipes version) working in Windows at all. So it is not too
>> surprising that it is not working for you now.
>
> May I ask what develop environment you used on Windows? I got the same
> errors from both Visual Studio 2008 and Mingw with Cygwin. I also
> noticed that Bio-Formats website has 32bit BF-ITK binary for download.
> I need a 64bit version so I can't use it, but it's still good to know
> how it was built.
>
>> If you do decide to investigate further and have any questions about it,
>> please do not hesitate to ask!
>
> I fixed those errors by using _pipe(), _write(), and _close() from
> <io.h>. The library itself compiled fine. But when load images at run
> time, I got this error:
>
> \src\bioformats\components\native\bf-itk-pipe\itkBioFormatsImageIO.cxx:229:
> BioFormatsImageIO: ITKReadImageInformation error:
> The handle is invalid
>
> The code before where this error happens is:
>
> int m_Pipe[2];                                    // Declared in
> BioFormatsImageIO.h by me.
> ...
> _pipe( m_Pipe, 512, O_BINARY  ) // This is my Windows version of pipe()
> m_Process = itksysProcess_New();
> itksysProcess_SetCommand( m_Process, m_Argv );
> itksysProcess_SetPipeNative( m_Process, itksysProcess_Pipe_STDIN,
> (itksysProcess_Pipe_Handle*)m_Pipe );
> itksysProcess_Execute( m_Process );
>
> m_Pipe has '3' and '4' after the _pipe(), so I think they were setup
> fine. Any idea?
>
> Thanks,
> Joe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkBioFormatsImageIO.cxx
Type: application/octet-stream
Size: 29434 bytes
Desc: not available
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20120427/2bfaed5b/attachment.obj>


More information about the ome-users mailing list