Testing with the sample dataset HG_29 now seems to match the results of the MATLAB processing.
This way is nicer anyway, because we don't need yet another way of numbering ROIs, but it also gives the right result. The previous hack from 661aca6 resulted in the wrong ROI order if the table in ROI.dat did not hold all ROIs with the same z-value consecutively.
We should add a test for this case to avoid regressions.
Testing with the sample dataset HG_29 now seems to match the results of the MATLAB processing.
This way is nicer anyway, because we don't need yet another way of numbering ROIs, but it also gives the right result. The previous hack from 661aca6 resulted in the wrong ROI order if the table in ROI.dat did not hold all ROIs with the same z-value consecutively.
We should add a test for this case to avoid regressions.