Hi Joe,<br><br>Thank you very much for investigating, and sending a patch. We really appreciate it. In the meantime, I did some digging of my own and concluded that the previous code must never have worked correctly on Windows (unless using gcc via Cygwin for the POSIX functions). So your work is definitely valuable.<br>
<br>Mark Hiner, one of the main BF-ITK developers, looked at your solution and says it seems to be working well, so we will integrate it into the official version shortly. However, I am traveling until next Monday, so it will be a little while before you hear back from me again. But we'll keep you posted!<br>
<br>Thanks again,<br>Curtis<br><br><br><div class="gmail_quote">On Fri, Apr 27, 2012 at 5:47 PM, Joe Ping-Lin Hsiao <span dir="ltr"><<a href="mailto:phsiao@cs.unc.edu" target="_blank">phsiao@cs.unc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Curtis,<br>
<br>
I modified bf-itk-pipe source so that it compiles and works on Windows<br>
7 64bit. What I did was replacing Linux system calls to the ones that<br>
work on Windows and fixing the code which depends on new line<br>
characters (Windows uses '\r\n' instead of just '\n').<br>
<br>
All I changed is just one file: itkBioFormatsImageIO.cxx, and I have<br>
attached the modified version. Search for '#ifdef WIN32' to see what<br>
the modifications are.<br>
<br>
Thanks,<br>
Joe<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Apr 16, 2012 at 1:25 PM, Joe Ping-Lin Hsiao <<a href="mailto:phsiao@cs.unc.edu">phsiao@cs.unc.edu</a>> wrote:<br>
> Hi Curtis,<br>
><br>
>> While we have not seen such compile errors per se, Windows support is<br>
>> definitely the least well tested. We have historically had a lot of<br>
>> difficulty getting the Bio-Formats ITK plugin (all three iterations of it,<br>
>> not just the pipes version) working in Windows at all. So it is not too<br>
>> surprising that it is not working for you now.<br>
><br>
> May I ask what develop environment you used on Windows? I got the same<br>
> errors from both Visual Studio 2008 and Mingw with Cygwin. I also<br>
> noticed that Bio-Formats website has 32bit BF-ITK binary for download.<br>
> I need a 64bit version so I can't use it, but it's still good to know<br>
> how it was built.<br>
><br>
>> If you do decide to investigate further and have any questions about it,<br>
>> please do not hesitate to ask!<br>
><br>
> I fixed those errors by using _pipe(), _write(), and _close() from<br>
> <io.h>. The library itself compiled fine. But when load images at run<br>
> time, I got this error:<br>
><br>
> \src\bioformats\components\native\bf-itk-pipe\itkBioFormatsImageIO.cxx:229:<br>
> BioFormatsImageIO: ITKReadImageInformation error:<br>
> The handle is invalid<br>
><br>
> The code before where this error happens is:<br>
><br>
> int m_Pipe[2]; // Declared in<br>
> BioFormatsImageIO.h by me.<br>
> ...<br>
> _pipe( m_Pipe, 512, O_BINARY ) // This is my Windows version of pipe()<br>
> m_Process = itksysProcess_New();<br>
> itksysProcess_SetCommand( m_Process, m_Argv );<br>
> itksysProcess_SetPipeNative( m_Process, itksysProcess_Pipe_STDIN,<br>
> (itksysProcess_Pipe_Handle*)m_Pipe );<br>
> itksysProcess_Execute( m_Process );<br>
><br>
> m_Pipe has '3' and '4' after the _pipe(), so I think they were setup<br>
> fine. Any idea?<br>
><br>
> Thanks,<br>
> Joe<br>
</div></div></blockquote></div><br>