Goldnet - extract masks/masked tilt serie

190 views
Skip to first unread message

Julien Maufront

unread,
Feb 13, 2023, 3:54:37 AM2/13/23
to Warp

Hi everyone,


I wanted to process my tilt series so as to remove the gold bead signals in each tilt.
I did a try with goldnet in WARP (GoldNet | Zenodo) and I must say the masks created seem to mask pretty well the gold beads in each tilt.

I am wondering now how to obtain the tilt serie with the gold beads removed or how to obtain the masks use for each tilt in order to apply it on the original tilt serie. 

I can see in the output of WARP a folder named "mask" containg tif files corresponding to the mask of each tilt but the dimensions are reduced :  696x720 for 4k tilt images. I don't know how I could use these files to mask out the gold beads in the original tilt serie. Does someone know a sofware which I could use to extend the dimensions of this images while preserving the mask shapes ?

Thanks for your help,
Julien Maufront

Alister Burt

unread,
Feb 13, 2023, 4:10:14 AM2/13/23
to Julien Maufront, Warp
Hi Julien,

Warp stores masks in a ‘mask’ folder and uses these to erase dirt/gold inside various programs, I don’t think this routine is exposed directly to users.

At some point we were having trouble running goldnet in Warp on 3090 cards so I reimplemented the detection/erasing of fiducials as a standalone Python package: https://teamtomo.org/fidder/

As a side note, erasing ’stuff' is provided as a separate program which requires an image and a mask as input, your masks could come from elsewhere.

If you have trouble with this/if it doesn’t perform well please reach out in the GitHub issues. The network performs well but hasn’t seen too much data, I could add a few images from your data to the public corpus of training data and update the pre-trained weights so everyone can benefit.

Cheers,

Alister



--
You received this message because you are subscribed to the Google Groups "Warp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to warp-em+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/warp-em/6ac143f2-d059-4456-9a95-c47d5365ce91n%40googlegroups.com.

Julien Maufront

unread,
Feb 13, 2023, 11:49:23 AM2/13/23
to Warp
Hi Alister,

I will take a look,  thanks a lot !

Cheers,

Julien  

Karin M

unread,
Jun 9, 2023, 5:21:57 AM6/9/23
to Warp
Dear Alister,

I have been trying to use fidder for generating the masks for Warp to remove gold beads from the tilt series. I am following the teamtomo tutorial and want to incorporate Warp in our pipeline. Unfortunately I am note able to use GoldNet because I am running Warp on RTX3080 Cuda card. For the fidder .mrc input I use the tilt averages generated by Warp. Most of the beads are masked but there are still some that are not covered by mask (in the attached). I tried to play with the probability threshold but it did not improve the results much. I also tried to provide a raw tilt .mrc (with 8 frames) but fidder will crash after it attempts to analyze the frame 9. I was wondering if Warp accepts a multi-frame mrc files? Is the average .mrc better as an input? Do I need to pre-train fidder (I have not tried the train option yet). Also I am interested if the masks will be used by Warp to erase the beads during the tomogram reconstruction? I just tested one mask (converted for the Warp-accepted .tif format with mrc2tif from IMOD) and I can see the beads being masked in the Real space tab but I still did not try to reconstruct the tomogram since I have problem to mask all beads.

Sorry for so many questions. Thank you so much for your help,
Karine

Screenshot 2023-06-09 171322.png

Lorenzo Gaifas

unread,
Jun 9, 2023, 6:00:24 AM6/9/23
to Karin M, Warp
Hi Karin,

I'll let Alister answer for fidder, but as for Warp: Yes, multiframe mrc are fine as far as I know (the mrcs input tab is what you need). I generally start with raw data in Warp and do all the motion correction there; one reason I prefer it is because it will allow you to automatically generate split averages with odd/even frames for denoising, if that's something you plan on doing later.

Yes, beads will be masked in tomogram reconstruction as well!

Best,
Lorenzo



Karin M

unread,
Jun 9, 2023, 6:40:01 AM6/9/23
to Warp
Dear Lorenzo, (sorry I will re-post my reply here :)

Thank you so much for the clarification! So far i am using the training data from EMPAIR database and they seem to be multiframe .mrc files. I am actually not very sure how actually Warp uses the masks to erase beads and are there any alternative ways to overcome this TensorFlow issue if unfortunately fidder won’t work. I was thinking to use ccderaser from IMOD but i am not sure how to integrate the results from ccderaser and Warp…..

Thank you once again!
Karine

Alister Burt

unread,
Jun 9, 2023, 7:06:40 AM6/9/23
to Karin M, Warp
Hi Karine,

Re: fidder - a few beads still present at high tilt is unlikely to cause any real issues, I’m always open to being sent more data to improve performance if out of the box isn’t good enough for people though. A few images from a few tilt-series with bad performance is usually enough to get it working well on any dataset. Fidder is supposed to be run on motion corrected images, not frame stacks. 

The latest version will also work with tilt-series/stacks, I would just expect terrible performance with frame stacks with so much less signal per frame. Could you send your traceback from the crash, ideally in the GitHub issues? https://github.com/teamtomo/fidder/issues

Re: GoldNet - Are you running the latest version of Warp (1.1.0)? Why not re-train the network yourself? From memory Dimitry moved all deep learning stuff over to PyTorch in 1.1.0 and that should work fine on your gpu

Cheers,

Alister

To view this discussion on the web visit https://groups.google.com/d/msgid/warp-em/06e189c8-565d-464d-a08f-9d3be5cebfc6n%40googlegroups.com.
<Screenshot 2023-06-09 171322.png>

Karin M

unread,
Jun 12, 2023, 6:29:32 AM6/12/23
to Warp
Dear Alister,

Thanks a ton! I did not know that Warp 1.1.0 existed :) I was running 1.0.9 (the latest stable version) and today I have replaced with the 1.1.0 beta and everything worked for me. I also have trained the boxnet3 for masking and it seems to be good for gold beads (GoldNet did not work with 1.1.0. It is not seen in the list of the available models for particle picking).

On fidder: i will post the error to Github. But when I get the error I run it on the raw multi-frame tilts (not a single average) which I am not supposed to do as far as I understand...

Anyway, thank you once again and sorry for bothering with many questions

Karine
Reply all
Reply to author
Forward
0 new messages