[Insight-users] Update: Running error with SegmentationEditor

Joshua Cates cates@sci.utah.edu
Wed, 9 Oct 2002 11:09:09 -0600 (MDT)


Hi,

I have checked a fix for this into the repository.  Let me know if this 
helps.

Thanks,

Josh.


>
> It seems that it's because of the file opening format difference between
> Unix and Windows. On windows, the default opening format is text format. 
In
> my case, in.gcount is 1558, listsz*sizeof(merge_t) is 234192

______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates@sci.utah.edu
 Phone: (801) 587-7697
 URL:   www.cs.utk.edu/~cates


On Wed, 9 Oct 2002, Xu, Yanjun wrote:

> Hi, 
>  
> It seems that it's because of the file opening format difference between
> Unix and Windows. On windows, the default opening format is text format. In
> my case, in.gcount is 1558, listsz*sizeof(merge_t) is 234192, while the tree
> file size on the disk is 235146. It seems that both the writing and reading
> function of tree file should be specified as binary format explicitly. Am I
> right? Thanks.
>  
> Sincerely,
> Yanjun
>  
> -----Original Message-----
> From: Xu, Yanjun 
> Sent: Wednesday, October 09, 2002 8:36 AM
> To: 'insight-users@public.kitware.com'
> Subject: Running error with SegmentationEditor
>  
> Hi, Dear All,
>  
> I'm trying to run SegmentationEditor. I succeeded in running data and
> preprocess module. While I was running the segmenter module, the program
> always stopped abnormally in this function. 
>  
> void vtkWSLookupTableManager::LoadTreeFile(const char* fn)
> {
> .
> .
> .
>   // now read the data
>   in.read((char *)(this->MergeList + 1), listsz * sizeof(merge_t));
>  
>   if (in.gcount() != listsz *sizeof(merge_t))
>     {
>       vtkErrorMacro(<<"Error reading " << fn << ". File size does not match
> header size.");
>       exit(-1);
> >>>> stop here
>     }
>  
>   in.close();
>  
> .
> .
> .
> }
>  
> Could anybody help to solve this problem? Thanks a lot.
>  
> Sincerely,
> Yanjun
>  
>