Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"xmipp_transform_mask" & "xmipp_transform_filter" save wrong wedge mask #225

Closed
MohamadHarastani opened this issue Jan 16, 2020 · 10 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@MohamadHarastani
Copy link
Collaborator

MohamadHarastani commented Jan 16, 2020

Hello,
I need to generate a missing wedge filter (I need the filter itself). I tried these functions "xmipp_transform_mask" and "xmipp_transform_filter". Both are giving strange results for the mask. Here are the commands I used:
xmipp_transform_mask -i volume.vol -o mask.vol --mask wedge -60 60
xmipp_transform_filter -i volume.vol -o filtered.vol --fourier wedge -60 60 --save filter.vol

The first command gives a box in the same size as the input but is not a wedge filter.
The second command gives a volume of different size of the input (my input is of size 64 64 64, and it gives a mask of size 33 64 64). The generated volume has two separate triangular prisms, that does not correspond to a -60 to 60 wedge, although the filtered volume (applying the wedge) seems to be correct somehow.
Any idea? if not, is there another function to generate a correct missing wedge?
Thanks

@DStrelak
Copy link
Collaborator

Hi @MohamadHarastani,

thanks for reporting this issue.
We will have a look at it shortly. You can expect some answer on Monday.

Thanks

@DStrelak DStrelak added the help wanted Extra attention is needed label Jan 17, 2020
@MohamadHarastani
Copy link
Collaborator Author

Hi @DStrelak ,
Thanks a lot
KR

@MohamadHarastani
Copy link
Collaborator Author

Hi @DStrelak
I am stuck due to this issue, I would really appreciate some help soon.
Thanks

@Vilax
Copy link
Collaborator

Vilax commented Jan 23, 2020

Hi @DStrelak
I am stuck due to this issue, I would really appreciate some help soon.
Thanks

Dear MohamadHarastani,

Thanks for getting in touch with us.

The right command is the second one, it means:

xmipp_transform_filter -i volume.vol -o filtered.vol --fourier wedge -60 60 --save filter.vol

The --fourier wedge -60 60 means that the information or data are between the tilt angles -60 to 60 degrees. So the missing wedged is a cone of angle 60º or 30 if you measure the angle between the axis and the generatrix.

This command present two outputs: 1) The filtered map -o filtered.vol, provides the output filtered map as you pointed out. 2) The applied filter. The missing wedge is applied in Fourier space, and because of the Hermitic symmetry, the half of this space can be removed, because the information is redundant (complex conjugate values). For that reason the filter has the half dimensions than your original map. I checked the command with a map, and the filter looks correct in Fourier space.

Do you need the filtered for any reason?

Anything else, please let me know

Kind regards

Vilas

@MohamadHarastani
Copy link
Collaborator Author

Dear @Vilax
Thanks for your detailed reply. When the mask is saved, how can I reuse it?
Meaning, say that I generate this mask using this command
xmipp_transform_filter -i volume.vol -o filtered.vol --fourier wedge -60 60 --save filter.vol
and I wand to use the mask on another volume or pass the mask to another function (namely this function: xmipp_volume_align).
There is an option to reuse this mask as:
xmipp_transform_filter -i somevolume.vol -o someoutput.vol --fourier binary_file filter.vol
This will give me an incorrect output!
Would you please elaborate more in this regard?
Thanks
Mohamad

@Vilax
Copy link
Collaborator

Vilax commented Jan 23, 2020

Dear @MohamadHarastani ,

If you want to apply a missing wedge to many maps, I recommend you to write a shell script with the command

xmipp_transform_filter -i volume.vol -o filtered.vol --fourier wedge -60 60

Xmipp (please someone correct me if I'm wrong) does not allow to take a binary file as input and directly applied in Fourier space as a mask. In other words, all mask you can applied in command line only work in real space. The solution I give you, it means, write an script that launches the command for all volumes, is perhaps not the most efficient, but I'm sure you can do it is short computational times.

Anything you need, do not hesitate to ask

Kind regards

Vilas

@cossorzano
Copy link
Contributor

Thank you, Vilas, for jumping on this. Your description is accurate.

@MohamadHarastani
Copy link
Collaborator Author

Dear @Vilax and @cossorzano
Thank you again for your time and help.
Actually, I am trying to compensate for the missing wedge while performing rigid body alignment. In other words, applying a missing wedge filter while aligning two volumes. Hence, this filter should be applied iteratively.
The program (xmipp_volume_align) has an option mask, and it permits selecting a wedge option (--mask wedge -60 60). Yet, this function depends on (xmipp_transform_mask) which in turn generates an incorrect filter (and eventually an incorrect output).
What I was trying to achieve, is to generate the missing wedge filter using "xmipp_transform_filter" as above, and pass its resultant filter to xmipp_volume_align. But this is not allowed as you say.

In summary, things are more clear, but there are two issues that need attention:
1- xmipp_transform_mask gives incorrect results for both wedge and cone.
2- How to use a wedge mask with xmipp_volume_align?
I will try to solve the second one. Please @cossorzano let me know if you already know how to do it or have any lead, clue or hint about it. (I have seen something here that seems to do that).

I sincerely appreciate all your time and efforts
Cheers,
Mohamad

@cossorzano
Copy link
Contributor

Dear @MohamadHarastani

note that the mask in xmipp_volume_align is meant to be a real space mask which is not what you want. To align two volumes using a wedge mask in Fourier, we only have the Fourier based algorithm that was published in Y. Chen, S. Pfeffer, J.J. Fernandez, C.O.S. Sorzano, F. Foerster. Autofocused 3D Classification of cryo-electron subtomograms. Structure, 22: 1528-1537 (2014). The way to call it is rather involved and you can see an example in https://github.com/I2PC/xmipp/blob/devel/src/xmipp/libraries/parallel/mpi_classify_CLTomo_prog.cpp.

This algorithm performs a global search of the alignment parameters, which in a context of normal modes I am not sure that is what you need. You may rather use xmipp_transform_filter as in

xmipp_transform_filter -i myvolume.vol -o myFilteredVolume.vol --fourier wedge -60 60

I have just checked that it works and seems to produce the appropriate filter.

@MohamadHarastani
Copy link
Collaborator Author

Dear @cossorzano
Thank you for the reference and the explanations. It is true that I need alignment with normal modes, however, it involves rigid body alignment. What I am trying to add is a compensation for the missing wedge during this rigid body alignment.
I have some ideas now to test and I will keep you posted.
Kindly,
Mohamad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants