Forum

Notifications
Clear all

sorting measurementlist by wavelength --> is data sorted too?


Helena Cockx
Posts: 4
Customer
Topic starter
(@helenacockx)
New Member
Joined: 12 months ago

Dear community,

When reading in one of mine .snirf-files I noticed the following:

in line 247 of the latest version of DataClass.m of Homer3 the MeasurementList rows are sorted based on the wavelengths:

% Sort according to wavelength
ml = sortrows(ml,4);

However, I don't see anywhere in the code where the order of the data is sorted accordingly. I am worried that the labeling of my data is not correct anymore because there is quite a difference between my labels (sorted by source-detector pair) and the sorted homer measurementlist (sorted by wavelength).
Am I overlooking a part in the code where the data is sorted or is the code handling this differently?
I have added one of my .snirf files so you can try it out yourself. 

Thank you in advance!

Kind regards,
Helena

8 Replies
Stephen Tucker
Posts: 52
Admin
(@sstucker)
Trusted Member
Joined: 2 years ago

Hi Helena,

Thanks for this. You are correct, this could lead to serious issues in the case where data is not sorted prior to import. This is some legacy code that shouldn't be there.

It actually came to our attention recently with the introduction of new time domain data from unfamiliar hardware, and so we are actively working on this-- try this developmental branch of Homer3 and compare the data labeling.

Reply
Helena Cockx
Posts: 4
Customer
Topic starter
(@helenacockx)
New Member
Joined: 12 months ago

It looks like my file was not added properly because it was too big in size. You can download it here: https://surfdrive.surf.nl/files/index.php/s/OSQ4KM2zq2oaNfJ  

Reply
Helena Cockx
Posts: 4
Customer
Topic starter
(@helenacockx)
New Member
Joined: 12 months ago

Hi Stephan,

Thanks for your reply and the suggestion to look at the developmental branch. For now, I just commented out the line where the measurement list is sorted and now my data makes much more sense. 🙂 Is there a reason to sort the measurement list for later steps, or is there no harm by just commenting this line out?
Also, would you like me to report such issues in the future on GitHub directly or just on this forum?

Thanks again!

Reply
Stephen Tucker
Posts: 52
Admin
(@sstucker)
Trusted Member
Joined: 2 years ago
Posted by: @helenacockx

For now, I just commented out the line where the measurement list is sorted and now my data makes much more sense.

This should work for display-- it is possible that some places in the code expect an ml matrix ordered by wavelength, but I have yet to find an explicit one. I'll update you here as I work on this.

Reply
4 Replies
Emma Condy
Registered
(@econdy)
Joined: 9 months ago

New Member
Posts: 2

@sstucker I am wondering whether or not this has been resolved in the latest version of Homer3?

I ask because I am currently running into an issue where my data are being incorrectly displayed on the probe when opened in Homer3. I have .nirs files which I am opening in Homer3 that are automatically converted to the .snirf format. I've looked at the measurementList within the .snirf files and from what I gather everything is correctly formatted and the proper wavelengths are indicated, etc. However, when I open them in Homer3 my data appear to have been resorted by wavelength such that my data is being read as if wavelengthIndex = 1 for the first 18 columns of my dataTimeSeries. This is resulting in a mixture of two wavelengths being displayed across channels when I select try to view my first wavelength in the Homer3 GUI. When I load the .snirf file, the formatting of my measurementList indicates that the wavelengthIndex = 1 for odd columns and = 2 for even columns so I am not sure why this resorting would be taking place and saw this previous thread thinking this could be the reason? Any pointers would be greatly appreciated!

Reply
Sreekanth kura
Moderator
(@skurabu-edu)
Joined: 2 years ago

Posts: 11

@econdy I will look into this. I still see that measurement list is sorted but I will look into if the data is also sorted accordingly. If it is okay with you, can you share the data with me so that I can verify after fixing the issue.

Sreekanth

Reply
Emma Condy
Registered
(@econdy)
Joined: 9 months ago

New Member
Posts: 2

@skurabu-edu Great, thank you. And yes - is there a way that I can email it to you separately to take a look at?

Emma 

Reply
Sreekanth kura
Moderator
(@skurabu-edu)
Joined: 2 years ago

Posts: 11

@econdy sure, can you email me at skura@bu.edu

Reply
Share:
en_USEnglish