cramerlab / warp

GNU General Public License v3.0
54 stars 16 forks source link

Accumulated dose is calculated from .mdoc DateTime, not ZValue #34

Closed McHaillet closed 2 years ago

McHaillet commented 2 years ago

Dear,

I really enjoy the software, just wanted to point you to this issue I encountered and a possible fix for your code.

When reading .mdoc files, the tilts are sorted based on collection time not on ZValue. We encountered a problem with this for a dataset where we had lost the original mdoc files and had to create some dummy mdocs. We did not add DateTime in the mdoc file (as we thought it was not used), which lead to a wrong dose accumulation per tilt in the .tomostar file. This could be seen in the fourier space tab in the .tomostar gui in Warp. The images were correctly ordered per tilt angle, only the accumulated dose was wrong.

I also noticed in the code above you keep track with a bool variable FoundTime whether DateTime could be read. This boolean is only put in place when reading the mdoc but not used later on. I think it would make sense to assign accumulated dose based on DateTime if its available, but add an additional check to do it on ZValue otherwise. Alternatively, you could leave DateTime out of it completely as the ZValue already contains the collection order of the tilts. People that try to spoof mdocs for data recorded with Tomo5 might also benefit from this fix.

Best wishes, Marten

dtegunov commented 2 years ago

Hi Marten,

Thanks, that's a good point. However, looking at original MDOC files from SerialEM, ZValue just goes from most negative to most positive tilt, which wasn't the order of acquisition. Perhaps SerialEM can be configured in different ways?

McHaillet commented 2 years ago

Hi Dimitry,

Thanks for the response. I think you are right, I checked with some other datasets in our group and there the ZValue is ordered with tilt angle. So DateTime is probably more reliable for the dose accumulation. Maybe good for spoofing to add incrementing DateTime!