Open bnwlkr opened 3 years ago
Hi Ben, thank you for looking into my work. What you intend to do should be feasible (from theoretical point of view). Indeed I look into similar direction when I was at the project. Meanwhile I switch to a different position and therefore do not actively develop tumorcode or VBL, but I am happy to assist. I updated the wiki for my tumorcode and VBL repository with some information concerning the combined simulation of tumorcode and VBL. I hope this gives you some directions. For VBL, you can implement bacteria as different cell type by defining the parameter according to your needs. Probably the most work is to develop some sort of interaction between different cell types (tumorcells and bacteria).
Best, Thierry
edit:resolved
Hi Thierry, thanks for the response! I followed along with the steps outlined in supplementary material to generate a bulk tissue model, but don't seem to able to visualize the actual tumour mass (only the blood vessels show). The steps I followed were:
./submitVesselgeneration -p default -t 8 -w 2000
. Succeeded, producing vessels-default-typeI-15x19L130-sample00.h5
../submitBulkTissue defaultconfig_bulktissue vessels−default−typeI−15x19L130−sample00.h5
. Succeeded, producing tumBulk-default-typeI-sample00-defaultconfig_bulktissue.h5
.submitPovrayRender tumBulk−default−typeI−sample00−defaultconfig bulktissue .h5 out0005 −p ’figure_plos_tumor’
. This produced this png:What I'm wondering is why this doesn't show the actual tumor tissue as in the paper:
The contents of the bulk tissue hdf5 file looks like this:
Maybe you can see something is missing from this? Or perhaps I just need to change something in the povray render step?
Thanks,
Ben
Hi Ben, thank you for pointing in this direction. I confirm the problem of plotting a bulktissue tumor with the current version of the code. I put some efforts for a quick fix with e04899b781dd4a023df14a93425e1a1fdd936e5f, but I could not solve the issue immediately. There is still a problem with the coordinates or scale transformation.
The background: I did not use the visualization with bulk tissue tumor after I implemented the cell type tumors.
If I find the time, I will come back to this issue.
Thanks Thierry your effort is much appreciated. I tried manually adjusting the scale of the normalization transform, i.e.:
def calc_centering_normalization_trafo(bbox_xxyyzz):
wb = bbox_xxyyzz
wb = wb.reshape((3,2))
sz = wb[:,1]-wb[:,0]
center = 0.5*(wb[:,1]+wb[:,0])
w = 1./max(*sz)
w *= 1.2 # <--------
return Transform(center, w)
and that causes the tumor to show up at least:
So it looks like some issue with scaling as you mentioned. Could you help me understand what the 'conc', 'necro', and 'ls' datasets represent? Plots of 'conc' and 'necro' look similar to me, and 'ls' (guessing levelset) is constants. In particular, I'm unsure about the difference between voldata_ls
and voldata_cells
and how they're being used in addBulkTissueTumor
:
voldata_ls = epv.declareVolumeData(ds_levelset, ld.GetWorldBox())
voldata_cells = epv.declareVolumeData(conc, ld.GetWorldBox())
value_bounds = voldata_cells.value_bounds
style = """
texture {
pigment {
function { %f + %f*%s(x,y,z) }
color_map {
[0.0 color <0.3,0,0>]
[0.5 color <1,0.8, 0.3>]
[0.8 color <1,1,0.1>]
}
}
finish {
specular 0.3
}
}""" % (value_bounds[0], (value_bounds[1]-value_bounds[0]), voldata_cells.name)
epv.addIsosurface(voldata_ls, 0., lambda : style, None, style)
Hi Ben, I am delighted that you made it work and found the right directions. Unfortunately most of the continuum/ level-set stuff was implemented by @DaWelter. Later I added a lot of hacks allowing me to reuse his scripts for the continuum stuff also in the case of the cell based simulations. If I remember correct, the voldata_cells was something like this. In essence the calculations of VBL and Tumorcode first happen on two individual lattices (world coordinates) and then second interact with each other. To reused the plotting scripts for the continuum part, I simple added all the VBL information on top and honestly never went back to check the implementation of the plotting stuff for consistency with the bulktumor stuff. Sorry. Maybe @DaWelter could comment on the precise naming of "conc", "necro" and "ls" (which I assume also all the time as levelset).
Hello both of you,
It's amazing that this project still attracts interest.
You are right. "ls" means levelset function. As per the nature of the levelset approach the corresponding arrays should be filled with the approximate (signed) distance to the tumor-normal-tissue interface. Up to a certain limit that is.
IIRC conc
and voldata_cells
might refer to the overall density of cells. I believe things labeled necro
refer to the fraction of necrotic tumor cells.
In the first stages of growth the necrotic cell fraction would be zero everywhere. Then a roughly circular necrotic core would develop. So at that point it would look indeed like the conc
(or cells
?) data because the density in the (circular) tumor would be higher than in normal tissue. The value ranges should be different though.
The code snippet you showed from addBulkTissueTumor
generates the iso-surface from the levelset function and color codes it according to voldata_cells
, which I'm pretty sure now is the cell density. The continuum model treats the tissue as slightly compressible.
Your change w *= 1.2 # <--------
is puzzeling though. How can a size increase of 20% make the isosurface suddenly appear. Sure you didn't change something else as well?
I hope I could help. Apologies for all the bad code :-< At least the naming could have been better.
On a general note: I think adding chemical concentration fields should not be that hard if they can be described similar to the oxygen concentration by solutions of steady-state diffusion-reaction equations. Then you can take the oxygen field as example. Even as time dependent problem it should be feasible. Regarding bacteria, I cannot be of much help. It would be beneficial if they can be treated as additional "layer" "on top of" the tissue without mechanical interaction. Tbh. I was struggling to make a multi-phase model with the three interacting phases tumor. Perhaps a particle based approach like @thierry3000 did is better. But beware what he did is very compute and memory intensive. So only small systems were possible.
I wish you good luck @bnwlkr . :-)
Cheers Michael
Thank you @DaWelter and @thierry3000 for your helpful feedback. edit:resolved
Dear Ben,
Thank you for reading my code carefully!!! Akin to @DaWelter I am delighted that this project still tracks attention. Unfortunately the lactate was out of the last project's scope. I can only point you to the line where VBL outputs "AcL_extra" ( https://github.com/thierry3000/VBL/blob/2ade538fdb2b0e8a15bd7a21ec2069c50db62d89/include/vbl/CellsSystem.h#L1403 ).
To understand VBLs calculation, I suggest studying the publications of @edymil or contacting him. I summarize the VBL software in chapter 2.3 of my dissertation ( https://publikationen.sulb.uni-saarland.de/bitstream/20.500.11880/30181/1/dissertation_Thierry_Fredrich_compiled_with_colored_links.pdf). There you find the detailed literature links.
Hope this helps.
Cheers, Thierry
On Wed, Jun 30, 2021 at 2:12 AM Ben Walker @.***> wrote:
Thank you @DaWelter https://github.com/DaWelter and @thierry3000 https://github.com/thierry3000 for your helpful feedback. Right now the team is working with data output included in the supp. material from your papers. Our project has particular need of the lactate concentration in the tumor; I noticed that here https://github.com/thierry3000/tumorcode/blob/f7d8530cc8632abf804ba806ccb8791099ecc7a3/src/tumors/faketum_mts.cpp#L1687 the option to output lactate concentration is commented out, along with a note saying that the lactate concentration can be derived from the pH. I was wondering if you could point me in the right direction re this calculation. Thanks! Ben
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thierry3000/tumorcode/issues/25#issuecomment-871001721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBDLJA4BXDXGOWRBW2FDCDTVJOP5ANCNFSM4ZXWSYZQ .
Hi Thierry, I’m a university student at UBC, Vancouver working on the dry lab of UBC’s undegraduate iGEM team. Our project this year aims to use tumor-colonising salmonella to detect the presence of an immune response in a tumor. We’re looking at modelling a 3D tumor and its microenvironment, and this project looks like a really great starting point. We’d like to be able to add to the simulation different intratumoral chemical/nutrient profiles and the growth/motility of bacteria within a tumor. Do you think that is feasible using your tumorcode project? Any guidance would be much appreciated. Thanks! Ben
P.S. I’ve got tumorcode running on ubuntu, but haven’t got the cells simulated yet. Could you give me any hints on how to get the vbl cell simulation integrated with my installation?