Hi Everyone, I have a question regarding the construction of 3D graphs in 'R', BUT these graphs also need to illustrate movement (with time) of the prostate gland (using radiological techniques). I am not sure how to do this in 'R' although I'm sure there is some way of doing it. Below, I have copied and pasted some of the data with which I'm working on. The data are for axial images of the prostate for four patients (N1, N2, N3 and N4) over 20 time points. The numbers represent the average amplitude of movement by the prostate gland in mm. The signs (positive and negative) indicate movement away from or toward the baseline, respectively. So, any deviation away from the baseline is '+' and any excursion toward baseline is negative (with the baseline indicated by Time=0). I would like to plot 3D graphs illustrating movement of the prostate with time for each of the four patients but do not know how. I am not an expert in 'R' so any help will be very, very much appreciated. Thanks. Best wishes, Suzanne Time N1 N2 N3 N4 0 0 0 0 0 1 121.8 -60.6 69.8 -122.6 2 19.9 -101.1 77.2 -142.9 3 19.9 -101.1 77.2 -120.4 4 19.9 -101.1 25.8 -131.1 5 44.2 -111.7 25.8 -128.6 6 44.2 -111.7 25.8 -305.7 7 50.5 -111.7 25.8 -232.4 8 75.8 -111.7 121.1 -201.8 9 63 -111.7 121.1 -201.8 10 3.3 -111.7 121.1 -201.8 11 38.9 -111.7 76.4 -175 12 38.9 -111.7 76.4 -175 13 -1.1 -111.7 76.4 -178.8 14 -103.1 -111.7 76.4 -176.2 15 -49.4 -111.7 76.4 -176.2 16 -80.6 -56.5 76.4 -176.2 17 -12.5 -94.7 -37.9 -171.6 18 -12.5 -94.7 -19.8 -186.4 19 -12.5 -94.7 -19.8 -241.1 20 -12.5 -59.4 9.8 -200 Suzanne St.Rose (DVM, MSc, PhD) Statistician Royal Marsden NHS Foundation Trust Fulham Road London SW3 6JJ Telephone: 0207 808 2186 Email: Suzanne.StRose@rmh.nhs.uk ######################################################################### Attention:\ This e-mail and any attachment is for author...{{dropped:19}}
On Dec 3, 2009, at 7:59 AM, StRose, Suzanne wrote:> Hi Everyone, > > I have a question regarding the construction of 3D graphs in 'R', BUT > these graphs also need to illustrate movement (with time) of the > prostate gland (using radiological techniques). I am not sure how > to do > this in 'R' although I'm sure there is some way of doing it. > > > > Below, I have copied and pasted some of the data with which I'm > working > on.From an unspecified software format?> The data are for axial images of the prostate for four patients (N1, > N2, N3 and N4) over 20 time points.You (and we readers) would be better served with the output of dput on the R object. That way you would not deliver an impossible-to-decode- list-of-solitary-numbers, which are now showing up along the left margin of the email that gets sent out from the list-server. -- David.> The numbers represent the average > amplitude of movement by the prostate gland in mm. The signs (positive > and negative) indicate movement away from or toward the baseline, > respectively. So, any deviation away from the baseline is '+' and any > excursion toward baseline is negative (with the baseline indicated by > Time=0). > > > > I would like to plot 3D graphs illustrating movement of the prostate > with time for each of the four patients but do not know how. I am > not an > expert in 'R' so any help will be very, very much appreciated. > > > > Thanks. > > > > Best wishes, > > Suzanne > > > > > > Time > > N1 > > N2 > > N3 > > N4 > > 0 > > 0 > > 0 > > 0 > > 0 > > 1 > > 121.8 > > -60.6 > > 69.8 > > -122.6 > > 2 > > 19.9 > > -101.1 > > 77.2 > > -142.9 > > 3 > > 19.9 > > -101.1 > > 77.2 > > -120.4 > > 4 > > 19.9 > > -101.1 > > 25.8 > > -131.1 > > 5 > > 44.2 > > -111.7 > > 25.8 > > -128.6 > > 6 > > 44.2 > > -111.7 > > 25.8 > > -305.7 > > 7 > > 50.5 > > -111.7 > > 25.8 > > -232.4 > > 8 > > 75.8 > > -111.7 > > 121.1 > > -201.8 > > 9 > > 63 > > -111.7 > > 121.1 > > -201.8 > > 10 > > 3.3 > > -111.7 > > 121.1 > > -201.8 > > 11 > > 38.9 > > -111.7 > > 76.4 > > -175 > > 12 > > 38.9 > > -111.7 > > 76.4 > > -175 > > 13 > > -1.1 > > -111.7 > > 76.4 > > -178.8 > > 14 > > -103.1 > > -111.7 > > 76.4 > > -176.2 > > 15 > > -49.4 > > -111.7 > > 76.4 > > -176.2 > > 16 > > -80.6 > > -56.5 > > 76.4 > > -176.2 > > 17 > > -12.5 > > -94.7 > > -37.9 > > -171.6 > > 18 > > -12.5 > > -94.7 > > -19.8 > > -186.4 > > 19 > > -12.5 > > -94.7 > > -19.8 > > -241.1 > > 20 > > -12.5 > > -59.4 > > 9.8 > > -200 > > > > > > Suzanne St.Rose (DVM, MSc, PhD) > > Statistician > > Royal Marsden NHS Foundation Trust > > Fulham Road > > London SW3 6JJ > > > > Telephone: 0207 808 2186 > > Email: Suzanne.StRose at rmh.nhs.uk > > > > > > > ######################################################################### > Attention:\ This e-mail and any attachment is for author...{{dropped: > 19}} > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD Heritage Laboratories West Hartford, CT
On 03/12/2009 7:59 AM, StRose, Suzanne wrote:> Hi Everyone, > > > > I have a question regarding the construction of 3D graphs in 'R', BUT > these graphs also need to illustrate movement (with time) of the > prostate gland (using radiological techniques). I am not sure how to do > this in 'R' although I'm sure there is some way of doing it. > > > > Below, I have copied and pasted some of the data with which I'm working > on. The data are for axial images of the prostate for four patients (N1, > N2, N3 and N4) over 20 time points. The numbers represent the average > amplitude of movement by the prostate gland in mm. The signs (positive > and negative) indicate movement away from or toward the baseline, > respectively. So, any deviation away from the baseline is '+' and any > excursion toward baseline is negative (with the baseline indicated by > Time=0). > > > > I would like to plot 3D graphs illustrating movement of the prostate > with time for each of the four patients but do not know how. I am not an > expert in 'R' so any help will be very, very much appreciated. >The rgl package allows you to put together 3D graphs, but the big issue is designing them. Do you know what you want it to look like? Duncan Murdoch> > > Thanks. > > > > Best wishes, > > Suzanne > > > > > > Time > > N1 > > N2 > > N3 > > N4 > > 0 > > 0 > > 0 > > 0 > > 0 > > 1 > > 121.8 > > -60.6 > > 69.8 > > -122.6 > > 2 > > 19.9 > > -101.1 > > 77.2 > > -142.9 > > 3 > > 19.9 > > -101.1 > > 77.2 > > -120.4 > > 4 > > 19.9 > > -101.1 > > 25.8 > > -131.1 > > 5 > > 44.2 > > -111.7 > > 25.8 > > -128.6 > > 6 > > 44.2 > > -111.7 > > 25.8 > > -305.7 > > 7 > > 50.5 > > -111.7 > > 25.8 > > -232.4 > > 8 > > 75.8 > > -111.7 > > 121.1 > > -201.8 > > 9 > > 63 > > -111.7 > > 121.1 > > -201.8 > > 10 > > 3.3 > > -111.7 > > 121.1 > > -201.8 > > 11 > > 38.9 > > -111.7 > > 76.4 > > -175 > > 12 > > 38.9 > > -111.7 > > 76.4 > > -175 > > 13 > > -1.1 > > -111.7 > > 76.4 > > -178.8 > > 14 > > -103.1 > > -111.7 > > 76.4 > > -176.2 > > 15 > > -49.4 > > -111.7 > > 76.4 > > -176.2 > > 16 > > -80.6 > > -56.5 > > 76.4 > > -176.2 > > 17 > > -12.5 > > -94.7 > > -37.9 > > -171.6 > > 18 > > -12.5 > > -94.7 > > -19.8 > > -186.4 > > 19 > > -12.5 > > -94.7 > > -19.8 > > -241.1 > > 20 > > -12.5 > > -59.4 > > 9.8 > > -200 > > > > > > Suzanne St.Rose (DVM, MSc, PhD) > > Statistician > > Royal Marsden NHS Foundation Trust > > Fulham Road > > London SW3 6JJ > > > > Telephone: 0207 808 2186 > > Email: Suzanne.StRose at rmh.nhs.uk > > > > > > > ######################################################################### > Attention:\ This e-mail and any attachment is for author...{{dropped:19}} > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
On Dec 4, 2009, at 7:07 AM, StRose, Suzanne wrote:> Hi again, > > Apologies for the last email I forwarded. Apparently, my data was > not legible. So, I have a question regarding the construction of 3D > graphs in ?R?, BUT these graphs also need to illustrate movement > (with time) of the prostate gland (using radiological techniques). > I am not sure how to do this in ?R? although I?m sure there is some > way of doing it. > > Below, I have copied and pasted some of the data on which I?m > working. The data are for axial images of the prostate for one > patient at 10 time points. On the axial images, A=anterior and > positive; L=left and positive, so that A negative=posterior and L > negative =right (see Figure 1 below). The signs (positive and > negative) indicate movement away from or toward the baseline, > respectively. So, any deviation away from the baseline is ?+? and > any excursion toward baseline is negative (with the baseline > indicated by Time=0). [Vector means the largest average directional > change relative to the nominated direction of assessment; numbers > are in mm]. >It may be clear to radiographers in the audience, but what those 4 x n numbers represent is not clear to me. Are they the lateral and AP boundaries of the prostate? What you write suggests these might be called "relative vectors", i.e. any point would be the vector sum? And why would we be plotting locations in 3d when this is an axial "slice"?> I would like to plot 3D graphs illustrating movement of the prostate > with time for each of the four patients but do not know how. > > Apologies again for the first email. I?ve attached an Excel file > (hope this is okay) with the same data as in Table 1. > > Hopefully this is a bit clearer. > > Thanks. > > Best wishes, > Suzanne > > > Table 1 > Patient_Axial > Time > Vector L > Vector R > Vector A > Vector P > 316868HO_DGE_cine1_ax_px >SNIPPED DATA that arrived as an xls file to my mail client ... since I suspect it did not reach most of the list: This is an R form of the data from what appears to be one patient as all rows are labeled: 316868HO_DGE_cine1_ax_px. Note to Suzanne... do not use spaces in R variable names. > dput(pat1) structure(list(Time = 0:10, VectorL = c(0, 1.6, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.3, 0, 0.2), VectorR = c(0, 1.5, 0.3, 0.3, 0.3, 1.6, 1.6, 1.8, 2.5, 2.3, -0.3), VectorA = c(0, 0, -0.3, -0.3, -0.3, -0.3, -0.3, -0.3, -0.4, -0.3, -0.2), VectorP = c(0, 1.9, -0.1, -0.1, -0.1, 0.1, 0.1, -0.1, 0.1, 0.4, 0.2)), .Names = c("Time", "VectorL", "VectorR", "VectorA", "VectorP"), class = "data.frame", row.names = c(NA, -11L))> > Figure 1. > > > <image001.gif> > > > > Suzanne St.Rose (DVM, MSc, PhD)> > > <Data_Three dimensional_01.xls>David Winsemius, MD Heritage Laboratories West Hartford, CT