I am trying to use FileHelper to read a csv file, in which data are arranged like this: 0,0,0,0,0,0,0,1,1,1,0,0,0,0,...... 1kX1k of them. Here is my FileHelper code:
[DelimitedRecord(",")]
public class ROIMaskCSV
{
public int value;
//[TransformToRecord(typeof(ROIMaskCSV[]))]
public static ROIMaskCSV[] loadMask(string fileName)
{
DelimitedFileEngine engine = new DelimitedFileEngine(typeof(ROIMaskCSV));
ROIMaskCSV[] mask = (ROIMaskCSV[])engine.ReadFile(fileName);
// mask[0].value = this.value;
return mask;
}
}
And here is where FileHelper loadMask() function gets called:
public class TIFFIImageIO
{
public static int LoadTIFF(string fileName, int x, int y)
{
ROIMaskCSV[] mask = ROIMaskCSV.loadMask("d:\\myMask.csv");
......
I stepped in, so when program gets:
ROIMaskCSV[] mask = (ROIMaskCSV[])engine.ReadFile(fileName);
the program is just freezed. I am not sure what happened. Something I did wrong? Anyone can give some pointers? Any suggestion is appreciated.