-
Notifications
You must be signed in to change notification settings - Fork 95
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
Motion corrected parametric objective function #240
base: master
Are you sure you want to change the base?
Conversation
d667071
to
d00a94b
Compare
a6eba77
to
0e3ee82
Compare
a5a4a04
to
73c5a57
Compare
ac75645
to
7aa1988
Compare
d1ad907
to
f5fc0e5
Compare
f5fc0e5
to
fd260ca
Compare
fd260ca
to
e40c3c4
Compare
e40c3c4
to
68203e5
Compare
d2f79b2
to
a377516
Compare
I don't seem to be able to get it working. Compilation errors are confusing (to me) but I think that what they are saying is that this derived class does not match the base class, which is what I was suspecting.
So this is in a point where I don't know how to tackle it. I assume this needs to comply with the Base class to be able to work seamlessly within STIR, but I do not know then how to pass the information that is needed there ti that ExamInfo |
Ok some ideas:
|
Thanks @rijobro, those are great suggestions! I guess I'll wait to see what @KrisThielemans prefers :) |
You could probably just comment it out for now. I'm not sure, but I don't think it'll be using the target image's time defs during the recon. It'll be updating it so that when it gets saved to interfile, it shows that the image is a composite of multiple time points. You'd have to check though, but I imagine that the Patlak analysis isn't currently clever enough to be using the time def inside of the target image. |
I was working on Windows for a bit and I moved to Linux now (Windows was acting up a bit) and I get the following error when compiling (after commenting out the problematic line above, as Rich suggested)
I see that - |
@AnderBiguri for your original problem. We can indeed not let this function modify the
There should normally be a |
The Obviously, that means we cannot merge this PR until we have moved the relevant motion bits. |
Again my C++ lacking. How do I check this? by comparing the getter return to an "empty" (non-set) |
This doesn't have anything (or at least very little) to do with C++ luckily. ...->get_time_frame_definitions().get_num_time_frames() or something with a similar name |
Apologies, I know how to get the time frames. But you said "if it has no time-frame defs, issue warning". The class will have time-frame defs as a member, and such member will be created by its default constructor when ExamInfo default constructor is called. My (C++) question is how do I know |
my wrong terminology, I just meant |
Thanks! I see now! ah, always the easiest solutions after an hour of reading half of stackoverflow.... Thanks :) |
You could check more than just the number of time frames (start and stop times of each frame). Not sure if time frame definitions class overloads the |
Yes they do! Checking the number of tf is just to see if they are set, but if there is more then zero, then I'm comparing them properly with == |
I managed to make it work, but I get images out of this that are completely zero in value as a recon result. I loaded up my own dynamic images that I am using with indirect patlak for my research, and have forward projected them. I generated multiplicative sinos that are of value 1 and additive sinos of value 0. I have created deformation fields filled with value zero too, to test if the code works without motion. I've been looking at the pieces of this for a bit now and I have no idea what can make the result all zero. Do you have any idea what to look at that I might have missed? I have checked that all sinos have "correct values (sino has sinograms, mult has all 1, add has all 0 etc). Its quite hard in STIR to make a minimal complete example, because there are many files needed for that, so let me know what extra info I can add here: Code that generates data, in SIRF.
Parameter file:
|
Update on the above: the sensitivity is all zeros, and that is what is causing the output to be all zeroes. I am trying to follow who does this subset computing, to see what happens, but I am a bit lost of where things are happening. |
can you try this without def fields first? If that works, can you make sure that the def fields are written as displacement fields? (then they should just contain zeros). There could be with writing the dvf to file, and STIR reading them properly (x,y,z quickly starts to loose meaning). It should work of course, but... |
Also, does the |
Without them "it works" (I am running 1 subset with 1 iteration, so "it works" means there is a blob in the image). With displacements instead of deformations (true, that was my mistake), the result is the same. The only thing I chahnged from the above code is
There is no such file. You mean (fixed, apparently |
Errors!
|
the same as what? Does it now "work" or still zero sensitivity?
yes, sorry
a bit strange to get syntax errors, as Travis runs it, and it's ok on |
they aren't if
oh well. Best thing to do is build with |
Returns zero images. The
Ok, step by step.
Im in Linux, how do I do this?
I have no idea what you mean. Change which script, the |
well, that's a nice bug then to look into... I'll have to let you figure some of this out, but what you say is in the correct direction. See e.g. https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html. Obviously, you don't have to use |
Yes! But I don't know where in this code are the calls to the frame sensitivities.... Been looking for a while. Thus the comment above (somewhere) Plus is strange that without motion they are not (I assume, as it does not return all zero for when I call this without DVFs) |
A small disclaimer: this wasn't working before I left, thus why we hadn't merged it. Unfortunately, I can't remember what wasn't working... Is there a unit test for running the non-rigid displacement (would have to be using the experimental version)? If so, is it currently being tested with the multi file? |
Ah! That makes sense and changes a bit how I am testing it, as I keep trying to find bugs in my code (as its 99.9% of the times, my fault, maybe this is the 0.1%!). Its good to know, thanks! I'll check what happens on those DVFs, as they seem to be causing some issues :) |
Apologies, should have flagged that up sooner! But really I can't remember which component(s) were causing issues. |
No worries! There were many things that I have being setting wrong until now, so its the right moment to flag that up 👍 |
Probably the same problem as #580 (comment) |
Requires on a lot of the other recent pull requests (i.e., reading of multicomponent images and projectors that allow motion.
This will fail all tests, as it hasn't been rebased onto the other pull requests.