DIDSR / VICTRE

Virtual Imaging Clinical Trial for Regulatory Evaluation
Creative Commons Zero v1.0 Universal
70 stars 12 forks source link

Need some help! #17

Closed stefanietang closed 2 years ago

stefanietang commented 2 years ago

Dear authors,

first of all thanks for the precious work.I am an undergraduate student.

I would like to ask you help because I am having a problem when installing the breastPhantom on my UBUNTU 16.04 machine.l have successfully completed the previous part,but in the process of lesion insertion, the Python code always fails to run successtuly, and it still fails to run successfully after modifying some parameters in it.

Can you give me some suggestions,really thank you! image

malago86 commented 2 years ago

Hello!

It looks like there is an issue with the random seed coming from /dev/urandom, your machine might not have that device configured. You can try to modify line 185 and remove the parameters on that function to initialize a random seed:

np.random.seed()

We also highly recommend you check the automatic VICTRE pipeline here: https://github.com/DIDSR/VICTRE_PIPELINE

You might find it easier to use since it is all contained on a single Python class, including the insertion step that you are having issues with. There are a few examples there on how to use it.

stefanietang commented 2 years ago

I have seen your reply, thank you very much! It helped me solve this problem, can I ask another question? Where should I get these parameters?I'm not quite sure if the parameters I entered are correct! Thanks again!

I don't know where to look for the value of "focal spot locations X,Y,Z"、"minimum voxel number in X,Y,Z"、“limit_chestX_vox”,and"cclus_voxlen",please let me know ! AND the second graph is information about pc_xxxx_crop.mhd! image image

malago86 commented 2 years ago

Focal spot is from the MCGPU run. Check what is the focal spot origin you are using, it will be something like 0 69 630 but it is different for different breast sizes. For the minvox you can probably use 0 0 0. Limit chest is up to you but something around 100 will be enough, depending on the thickness of your chest wall on the phantom model.

You don't have to worry about any parameter if you use the automatic pipeline.

stefanietang commented 2 years ago

Thanks for your quick answer! But I still encounter the following problem, can you give some more suggestions? image

stefanietang commented 2 years ago

Yesterday I have used the automatic pipeline you suggested, but still have the following problem, I have added FEBio's path, I don't know why this happens? Can you help? image image

malago86 commented 2 years ago

You have to run the install.sh first to compile all the tools. It has instructions on how to compile it. Your error shows that the breast generation software was not compiled.

stefanietang commented 2 years ago

Really appreciate your answers! But I have successfully installed vtk, why is this still happening? image

malago86 commented 2 years ago

Make sure you have all the libraries needed installed with:

apt-get -qq update
apt-get -y -qq install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev cmake libblas-dev liblapack-dev libopenmpi-dev libboost-dev libboost-program-options-dev libproj-dev libtet1.5-dev zlib1g-dev gzip python3-pip fftw3 vtk6 libvtk6-dev libiomp5 libiomp-dev

If VTK6 is installed, try to run the compilation even if it says NOT FOUND. It might still be able to find it and compile the breast generation and breast compression software.

stefanietang commented 2 years ago

I am so sorry to bother you so much!I tried to solve this problem for a long time,but there were still some problems!I have solved the problem of not finding VTK_DIR,but cannot solve the problem of finding boost. And I have already tried to run the compilation,but it failed at the first step(breast generation). can you take some time to teach me?? image

malago86 commented 2 years ago

Can you check you have the boost library installed on your system, or install it if it's not done yet?

apt-get -y -qq libboost-dev libboost-program-options-dev

That should make it available even if it says not found. I am actually able to compile it without the VTKDIR and boost saying FOUND on the script.

Can you paste the error during the compilation?

stefanietang commented 2 years ago

Really thank you!!!AND the error during the comilation is following: /home/gang/tangyang/VICTRE_PIPELINE/Victre/generation/breastPhantom.cXX:398:10: warning: ignoring return value of ‘size_t fread(void, size_t, size_t,FILE)',declared with attribute warn_unused_result [-wunused-result] fread((char*)(&randseed), sizeof(int),i,randFile);

[100%] Linking_ cxx executable breastPhantonMain /usr/bin/ld:cannot found-lvtkNrappingTools collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/breastPhantowMain.dir/build.nake:207: breastPhantomMain]error1 make[1]:[CNakeFiles/Hakefile2:96∶ CMakeFiles/breastPhantonMain.dir/all] error 2 make: ***[Makefile:84: all] error 2 what do you want to compile? 1.Breast generation 2.Breast conpression3.Breast mass 4.MCGPu projection 5.Reconstruction software

malago86 commented 2 years ago

It looks like it can't find VTK, you can try to reinstall it or find it, for me it is located here: /usr/lib/cmake/vtk-6.2

Try to run this on the main directory (where the install.sh is located): cat Victre/generation/build/CMakeCache.txt | grep vtk

For me, this shows up after running that command: VTK_DIR:PATH=/usr/lib/cmake/vtk-6.2

And that directory contains all the vtk cmake files. Can you check that for me? Otherwise, you must have VTK somewhere else. If so, you can change the folder editing the beginning of install.sh and uncommenting/modifying the VTK_DIR line to point to your VTK installation directory.

stefanietang commented 2 years ago

When I run this command,this shows: VTK_DIR:PATH=/usr/local/lib/cmake/vtk-7.1 image And I have modified install.sh image

but the same problem arise,Is it because of VTK's version or ubuntu's version?I can find libvtkWrappingTools-7.1.a in /usr/lib !!! image /home/gang/tangyang/VICTRE_PIPELINE/Victre/generation/breastPhantom.cXX:398:10: warning: ignoring return value of ‘size_t fread(void, size_t, size_t,FILE)',declared with attribute warn_unused_result [-wunused-result] fread((char*)(&randseed), sizeof(int),i,randFile);

[100%] Linking_ cxx executable breastPhantonMain /usr/bin/ld:cannot found-lvtkWrappingTools collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/breastPhantowMain.dir/build.nake:207: breastPhantomMain]error1 make[1]:[CNakeFiles/Hakefile2:96∶ CMakeFiles/breastPhantonMain.dir/all] error 2 make: ***[Makefile:84: all] error 2

malago86 commented 2 years ago

You can ignore the warning there. Is there any error after the [100%] Linking now? I can't see it on your screenshot.

Can you confirm that vtk is indeed located here? /usr/local/lib/cmake/vtk-7.1

If you used the line I gave you before to install the dependencies, you should have vtk6 not 7. VTK7 is also compatible, but, can you try uninstalling 7 and installing 6?

This is the command I recommended: apt-get -y -qq install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev cmake libblas-dev liblapack-dev libopenmpi-dev libboost-dev libboost-program-options-dev libproj-dev libtet1.5-dev zlib1g-dev gzip python3-pip fftw3 vtk6 libvtk6-dev libiomp5 libiomp-dev

That works on an Ubuntu system, I tried it on a few different systems so it should work. You can also play with the pipeline on this Google Colab notebook: https://colab.research.google.com/drive/1g8bwH_nuVRn3xJcoqP-zT7bz8kY4Nuqz?usp=sharing

There are instructions and an example on how to run the projection/reconstruction. And at the end you have the commands needed to compile all the tools, make sure you are doing the same.

stefanietang commented 2 years ago

Really thank you!And I have solved this problem.I am currently doing Breast Mass generation,but I don't know exactly how the microcalcifications are formed after viewed related papers.Is it the same as breast mass formation?I would appreciate it if you could reply to me .

malago86 commented 2 years ago

Calcifications were generated manually, there is no software to make them but that is a good addition to consider in the future!

stefanietang commented 2 years ago

I got it! Thanks again! And if I want to get X-ray projection images of two different energies, is this possible?

malago86 commented 2 years ago

Of course, you can make all the changes you want to the projection, take a look at the MCGPU parameters that you can change here: https://github.com/DIDSR/VICTRE_PIPELINE/blob/main/Victre/Constants.py#L133

Then, it's as easy as initializing the pipeline with your modified numbers like this:

pline = Pipeline(seed=1,
   arguments_mcgpu={"number_histories":11e9}
)
pline.project()
pline.reconstruct()

[...] whatever other code you want here [...]

That changes the number of histories to 11e9, it's just an example, you can change any of the input parameters by adding it there. Hope it helps!