OSIPI / TF2.4_IVIM-MRI_CodeCollection

OSIPI TF2.4: IVIM MRI code collection
Apache License 2.0
9 stars 27 forks source link

Generate a variety of testing data and came up command_line version of sim_vim_sig.py #51

Closed Unique-Usman closed 6 months ago

Unique-Usman commented 6 months ago

A clear and concise description of what you want to happen Added this two files. sim_ivim_sig_command_line.py - This is the command line version of the sim_vim_sig,py sim_ivim_sig_mul_bval.py - This version is used for running multiple b_value which are stored in b_values.py

Various test files based on the multiple value of b_value in the b_values.py ├── generic_five.json ├── generic_four.json ├── generic_original.json ├── generic_three.json ├── generic_two.json

Also, the generic_original.json was supposed to be the same thing as generic.json. But, the result is not the same. I guess the generic.json was generate from another b_value different from the current one.

Also, @etpeterson what do you think about combining the three scripts(sim_ivim_sig_command_line.py, sim_ivim_sig_mul_bval.py, sim_ivim_sig.py) together instead of having multiple scirpts doing almost similar thing ? What we can do is to just have a single script that can be used as command line tools and is able to generate multiple value of test data based on the multiple b_values.

I will update the pr based on your feeedback and also come up with a documentation for running the scipt.

Link this PR to an issue [optional]

Fixes #41

Checklist

etpeterson commented 6 months ago

Yes, I think it should just be one script, just changes to the original sim_ivim_sig.py would be great. One of the inputs could be a choice for bvalues to generate.

The change to generic.json looks like somehow the newline at the end got dropped, but the contents are the same. It's hard to say how this happened because it's difficult to see changes with the duplicated script. Once everything is all together then it'll be easier to look at the changes made.

Unique-Usman commented 6 months ago

A clear and concise description of what you want to happen I have converted the script to one sim_ivim_sig.py. Now it is able to take multiple bvalues through a json file. Also it can also take a single value through command line. The default value is also present.

Various test files based on the multiple value of b_value in the b_values.py ├── generic_0.json ├── generic_1.json ├── generic_2.json ├── generic_3.json ├── generic_4.json

Also, the generic_0.json was supposed to be the same thing as generic.json as I used the placeholder bvalue for it. But, the result is not the same. I guess the generic.json was generate from another b_value different from the current one. (I did not make any change to generic.json.)

There might also be a need for me to explain the changes made through a call or recording @etpeterson

I will update the pr based on your feeedback and also come up with a documentation for running the scipt.

Link this PR to an issue [optional] Fixes https://github.com/OSIPI/TF2.4_IVIM-MRI_CodeCollection/issues/41

Checklist Self-review of changed code Added automated tests where applicable Update Docs & Guides

Unique-Usman commented 6 months ago

@etpeterson Kindly go through the comment, then I can make the necessary changes. Thank you.

Unique-Usman commented 6 months ago

I changed the generic_0.json. Also correct the mistake in the script. Also changed the -bf option flag to -f flag.

What I was saying regarding the generic.json is that, the value in generic_0.json was supposed to be the same thing with the generic.json. Because, the bvalue for generic_0.json was the one bvalue in the repo. My suggestion is that, the bvalue used to generate generic.json is different from the one present in the repo.

etpeterson commented 6 months ago

What I was saying regarding the generic.json is that, the value in generic_0.json was supposed to be the same thing with the generic.json. Because, the bvalue for generic_0.json was the one bvalue in the repo. My suggestion is that, the bvalue used to generate generic.json is different from the one present in the repo.

Is this still different? We can see the bvalues used for generic.json in the file itself. And I can see they are the same as the default set you're using. Is it different on the main branch too? I would be surprised if it's different on the main branch so that would be a good place to check.

Unique-Usman commented 6 months ago

@etpeterson , I ran it on the unchaged main branch and it still give the different result from the generic.json. Yeah, the bvalues used is the same, something is wrong somewhere I guess.

etpeterson commented 6 months ago

@etpeterson , I ran it on the unchaged main branch and it still give the different result from the generic.json. Yeah, the bvalues used is the same, something is wrong somewhere I guess.

That is surprising. What's the difference?

Unique-Usman commented 6 months ago

All the decimal values Screenshot from 2024-03-07 11-32-45

etpeterson commented 6 months ago

This is strange. I don't know why that would change. The history doesn't show meaningful changes to that file. I'll give it a shot.

Also, unfortunately you have a merge conflict.

etpeterson commented 6 months ago

I'm not sure what to say, but it worked for me, I got the same data in both. Here are my steps.

Unique-Usman commented 6 months ago

Did you move the utitlities to the phantoms/MR_XCAT_qMRI when running the code ?

etpeterson commented 6 months ago

Did you move the utitlities to the phantoms/MR_XCAT_qMRI when running the code ?

No, if the pythonpath is set correctly it finds them where they are. Even if you pull the images manually I think the result should be the same though.

Unique-Usman commented 6 months ago

Yeah, I was able to get the same data. But, do we want to add https://github.com/OSIPI/TF2.4_IVIM-MRI_CodeCollection/blob/main/phantoms/MR_XCAT_qMRI/sim_ivim_sig.py#L13 to the script. This keeps downloading all the data everytime.

etpeterson commented 6 months ago

This keeps downloading all the data everytime.

If that's the case then it sounds like a good issue to be fixed in a different pull request.

etpeterson commented 6 months ago

I'll try to actually run it later and test that, but the code looks good to me at the moment. Just a few changes still pending.

etpeterson commented 6 months ago

Yeah, I was able to get the same data

What was the problem? Is it something that we can fix with some instructions or code?

Unique-Usman commented 6 months ago

This keeps downloading all the data everytime.

If that's the case then it sounds like a good issue to be fixed in a different pull request.

I think, if possible, we should have the downloading of data separately. Then, in the documentation for running the code that I will be providing, I will mention it there.

Unique-Usman commented 6 months ago

f that's the case then it sounds like a good issue to be fixed in a different pull request.

I really think it is some mix up somewhere, probably I deleted or add some code mistakenly. I resolved the problem by rewriting the code from the start.

etpeterson commented 6 months ago

I think, if possible, we should have the downloading of data separately. Then, in the documentation for running the code that I will be providing, I will mention it there.

We shouldn't try to reimplement git-lfs here, but also a simple check to see if the requisite files are present and if not then download seems pretty easy. If it's in the document and in the code then requiring two steps is fine.