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

Does Warpy can be used in script? Do you have introduction? #17

Open
HanYanxi opened this issue Oct 19, 2023 · 20 comments
Open

Does Warpy can be used in script? Do you have introduction? #17

HanYanxi opened this issue Oct 19, 2023 · 20 comments

Comments

@HanYanxi
Copy link

I need to process lots of images. Can I use the command like run('Warpy') to use it?

@NicoKiaru
Copy link
Member

NicoKiaru commented Oct 19, 2023

Unfortunately, there's no easy way to batch Warpy currently, but it's on our TODO list at the facility.

It will become possible, but nothing will be done before next month. I hope to have a batch feature available by the end of 2023.

ping @romainGuiet

@HanYanxi
Copy link
Author

Thank you! And if I have an image like this, could you give me some advice to set the parameters in the beginning?
image

@NicoKiaru
Copy link
Member

NicoKiaru commented Oct 19, 2023

Oh, whoa, these are gigantic pixels! Are you sure of these ? The object you image is 2 meters long ?

If that's correct, I would try something like:

Pixel size coarse = 800
Patch size = 40000
Pixel size precise = 80
#iteration = 100 (same)

Basically everything multiplied by 80,

@HanYanxi
Copy link
Author

It's a whole slide of fluorescent. Yes, you are right. It's impossible. Because when I followed your YouTube video. It produced the pixel width and length automatically. But I don't know the physical size of this slide. It's a problem. Can I adjust them like pixel width 0.84, and pixel length 0.84?

@HanYanxi
Copy link
Author

Can I ask one more question about the registration process? Because I am using 2D images to register. What does the "remove images z-offset" do in the first step?

@NicoKiaru
Copy link
Member

What does the "remove images z-offset" do in the first step?

You can keep it checked without any issue. It's a subtle issue: the planes are positioned along Z in the bio-formats library. And the z-offset can be different between the moving and the fixed image. By keeping this option checked, you make sure that the offset is ignored - which is what you want to do in 99% of the cases.

@elect86
Copy link
Collaborator

elect86 commented Oct 30, 2023

I need to process lots of images. Can I use the command like run('Warpy') to use it?

Maybe I may help: what kind of processing are you looking for, exactly?
How do you process right now a single image and where are the images you would like to batch? All in one folder?

@NicoKiaru
Copy link
Member

Hi @elect86 !

The batching is possible in theory but it is rather annoying right now. The Warpy wizards runs commands within commands and uses the SciJava framework to pass arguments.

The main Warpy wizard command is here:

https://github.com/BIOP/bigdataviewer-biop-tools/blob/master/src/main/java/ch/epfl/biop/scijava/command/source/register/WarpyRegisterCommand.java

And calls this command... which is doing some stuff in the UI, so not ideal for batching.

https://github.com/BIOP/bigdataviewer-biop-tools/blob/master/src/main/java/ch/epfl/biop/scijava/command/source/register/Wizard2DWholeScanRegisterCommand.java

I need to re-design these commands, or make a parallel API for easy batching. I should have known that it was bad design, even from the start... but well, here's another lesson I needed to taught myself one more time.

@HanYanxi
Copy link
Author

What does the "remove images z-offset" do in the first step?

You can keep it checked without any issue. It's a subtle issue: the planes are positioned along Z in the bio-formats library. And the z-offset can be different between the moving and the fixed image. By keeping this option checked, you make sure that the offset is ignored - which is what you want to do in 99% of the cases.

Okay! Thank you. May I ask do you know some plugins could do remove z-offsets in imageJ?

@NicoKiaru
Copy link
Member

May I ask do you know some plugins could do remove z-offsets in imageJ?

I'm not sure what's the context of your demand. Honestly, I don't think it's an issue you will encounteer anywhere else than in Warpy

@HanYanxi
Copy link
Author

I need to process lots of images. Can I use the command like run('Warpy') to use it?

Maybe I may help: what kind of processing are you looking for, exactly? How do you process right now a single image and where are the images you would like to batch? All in one folder?

Hi @elect86,
It looks: like I have 3 images, they are in the same folder. And I want to use Warpy to align them. But I want to do it automatically. Because I have maybe more than 5 folders.

@HanYanxi
Copy link
Author

May I ask do you know some plugins could do remove z-offsets in imageJ?

I'm not sure what's the context of your demand. Honestly, I don't think it's an issue you will encounteer anywhere else than in Warpy

Does that mean "removing the z-offsets" and "center moving image with fixed image" are used for manual rigid registration?

@NicoKiaru
Copy link
Member

Does that mean "removing the z-offsets" and "center moving image with fixed image" are used for manual rigid registration?

Both options are there to help with the initial state. There are not used per se for the registration. It's just that if the images are not overlapping at all when you start the registration process, the wizard will just not work. So, initially, you just want to re-center both images. That's what these options are for. It's just there to help at the beginning of the registration process.

You can just experiment and see what happens if you disable them.

@HanYanxi
Copy link
Author

Does that mean "removing the z-offsets" and "center moving image with fixed image" are used for manual rigid registration?

Both options are there to help with the initial state. There are not used per se for the registration. It's just that if the images are not overlapping at all when you start the registration process, the wizard will just not work. So, initially, you just want to re-center both images. That's what these options are for. It's just there to help at the beginning of the registration process.

You can just experiment and see what happens if you disable them.

Okay! Thank you so much for your reply!

@HanYanxi
Copy link
Author

HanYanxi commented Nov 2, 2023

Can I ask a question about Warpy registration? When I start registration, it shows these errors, and I can't export the registered images using "export warpy registered image".
image

@NicoKiaru
Copy link
Member

NicoKiaru commented Nov 2, 2023

Yeah, the export from Warpy is indeed broken currently, sorry. I've opened an issue (BIOP/bigdataviewer-biop-tools#55).

The current alternative is to export from QuPath, cf:

https://forum.image.sc/t/saving-to-ome-tiff-slow-warpy-and-qupath/69153

@HanYanxi
Copy link
Author

HanYanxi commented Nov 2, 2023

Yeah, the export from Warpy is indeed broken currently, sorry. I've opened an issue (BIOP/bigdataviewer-biop-tools#55).

The current alternative is to export from QuPath, cf:

https://forum.image.sc/t/saving-to-ome-tiff-slow-warpy-and-qupath/69153

okay, thank you. When I did registration it also shows errors.
image

@NicoKiaru
Copy link
Member

Is Fiji up to date ? Do you have elastix 5.0.1 ( and not elastix 5.1.0 ) ?

Please check the script refered in https://biop.github.io/ijp-imagetoatlas/#i-cant-start-any-elastix-registrations

And make sure that you select 'MILLIMETER' when importing the QuPath project

@HanYanxi
Copy link
Author

HanYanxi commented Nov 2, 2023

image
the folders are like this, I didn't change them.

@NicoKiaru
Copy link
Member

Ah, ok.

Could you try to run the test script mention in the link I've sent above and let me know how that goes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants