-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add --output-rescale #126
base: master
Are you sure you want to change the base?
Add --output-rescale #126
Conversation
and by default do not rescale the output.
Hello T, it works. I can apply tofu sinos twice to 8 or 16 bit data with and get the same projections as the original imput. I have one suggestion: would it be possible, for the sake of simplicity, to enforce rescale automatically if minimum and maximum are specified explicitly? I'm testing the behavior of tofu reco and if I call reco with What do you think? I imagine it might require a couple of extra "if" statements in the tofu reco and tofu sinos but, unless I'm omitting something, it will be more transparent that way. Let me know what do you think. If you can do it then I do not have to change anything in tofu ez. If you prefer to keep it more robust and simpler in the code, then I need to add "--output-rescale" in a couple of places in tofu ez before we can merge it with master. Cheers, |
That makes sense, so let's turn on |
Yeah, that is a good idea - can be useful to clip data at one end of the intensities. |
Here we go, please test and don't forget to pull also the branch in ufo-filters:#224 before. |
Hello Tomas, I tested it and it works. Except for when you call "reco" and specify --output-bitdepth only. Then it returns all zeros. If you specify --output-bitdepth together with --output-rescale then it returns correct values stretched to the respective clims. Interestingly, when you call tofu sinos and specify bitdepth only, it returns correct output so if you apply tofu sinos twice (projections-->tomo-->projectsions) with bitdepth 16 flag and nothing else you would get your original input projects (which is exactly what I needed to organize vertical stitching of orthogonal sections for slices reconstructed in arbitrary bitdepth) Returning to tofu reco, I do not know why it happens, but, just in order to avoid zeros, it appears that yet another condition statement like Wish you very pleasant Holidays, |
Hm, when I use output bitdepth without the rescale flag, it gives me zeros also for With tofu reco the situation is a little bit more complicated beyond the issue with zeros. When the user specifies the output with the .tif extension, then the writing is actually done on the python side to ensure proper ordering of slices, i.e. I get the slices into memory and write them by |
Hello, i've just confirmed what you see - if I enable ffc than I also get zeros in the output of tofu sinos if only bitdepth is set. In my initial test I was basically reslicing raw projections twice so the input was in 16 bit. Not sure how do you want to go about that; as I mentioned in my view trying to convert floating point numbers into integers without defining the output interval is meaningless anyways so I would just leave it as is. |
Would it make your life easier to merge this now? If not I'd leave it open and polish also the single-tif writing and so on. |
Hi, I should definitely upgrade our servers this week, it has been long overdue, but I can use the current add-rescale branch. Not sure what you mean with single tif writing, I didn't notice anything wrong with that |
Alright, let's leave this alive then for a little longer. By single tif writing I mean that in case you want just one output file I get the slices from the GPUs and write them on the python side, which is not optimal and I wanted to update that. |
Hi @sgasilov , can we close this? |
Hola! If you finished all that little things which you wanted to finish then of course! Also, could you merge ez-dev then with master after you add --output-rescale to master? |
and by default do not rescale the output. @sgasilov the rescale was actually happening by default, this PR makes it so that when you do not specify
--output-rescale
it won't happen, otherwise yes, i.e. the old behavior.