Which data structure for multidimensional MRI data (multiple methods, slices, segments) in R?
up vote
0
down vote
favorite
I am still a beginner in R and have been using Excel to organize my data and it is very messy, so I want to put everything in some data structure in R to later visualize it.
My data consists of values obtained from an algorithm that analyzes each pixel of MRI images of an organ. The images are obtained using two different methods (method A and B), and the organ is imaged in 8 slices, covering the entire organ. Each image of the organ is segmented into 6 anatomical segments, and our MATLAB code takes the average and SD of the pixels in each segment.
At the end of the analysis, I have 4 tables. Two for averages (one for each method) and two for SD values (one for each method). The columns of the tables represent segments (segments 1-6) and the rows are the slices (slices 1-8). This is for one patient, and we are scanning several patients.
I want to organize the data such that it is easy to create visualizations such that I can compare different methods for all patients, or look at the values for the different slices, or simply look at specific segments.
If I use one dataframe, should each observation be a slice? Or a single value from a single slice and segment? Should I use multiple dataframes? I am a little lost on how to best organize this, as I've had no previous experience with datasets.
Thank you for your help, and if more clarification is needed, please let me know.
r dataframe
add a comment |
up vote
0
down vote
favorite
I am still a beginner in R and have been using Excel to organize my data and it is very messy, so I want to put everything in some data structure in R to later visualize it.
My data consists of values obtained from an algorithm that analyzes each pixel of MRI images of an organ. The images are obtained using two different methods (method A and B), and the organ is imaged in 8 slices, covering the entire organ. Each image of the organ is segmented into 6 anatomical segments, and our MATLAB code takes the average and SD of the pixels in each segment.
At the end of the analysis, I have 4 tables. Two for averages (one for each method) and two for SD values (one for each method). The columns of the tables represent segments (segments 1-6) and the rows are the slices (slices 1-8). This is for one patient, and we are scanning several patients.
I want to organize the data such that it is easy to create visualizations such that I can compare different methods for all patients, or look at the values for the different slices, or simply look at specific segments.
If I use one dataframe, should each observation be a slice? Or a single value from a single slice and segment? Should I use multiple dataframes? I am a little lost on how to best organize this, as I've had no previous experience with datasets.
Thank you for your help, and if more clarification is needed, please let me know.
r dataframe
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 at 20:29
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am still a beginner in R and have been using Excel to organize my data and it is very messy, so I want to put everything in some data structure in R to later visualize it.
My data consists of values obtained from an algorithm that analyzes each pixel of MRI images of an organ. The images are obtained using two different methods (method A and B), and the organ is imaged in 8 slices, covering the entire organ. Each image of the organ is segmented into 6 anatomical segments, and our MATLAB code takes the average and SD of the pixels in each segment.
At the end of the analysis, I have 4 tables. Two for averages (one for each method) and two for SD values (one for each method). The columns of the tables represent segments (segments 1-6) and the rows are the slices (slices 1-8). This is for one patient, and we are scanning several patients.
I want to organize the data such that it is easy to create visualizations such that I can compare different methods for all patients, or look at the values for the different slices, or simply look at specific segments.
If I use one dataframe, should each observation be a slice? Or a single value from a single slice and segment? Should I use multiple dataframes? I am a little lost on how to best organize this, as I've had no previous experience with datasets.
Thank you for your help, and if more clarification is needed, please let me know.
r dataframe
I am still a beginner in R and have been using Excel to organize my data and it is very messy, so I want to put everything in some data structure in R to later visualize it.
My data consists of values obtained from an algorithm that analyzes each pixel of MRI images of an organ. The images are obtained using two different methods (method A and B), and the organ is imaged in 8 slices, covering the entire organ. Each image of the organ is segmented into 6 anatomical segments, and our MATLAB code takes the average and SD of the pixels in each segment.
At the end of the analysis, I have 4 tables. Two for averages (one for each method) and two for SD values (one for each method). The columns of the tables represent segments (segments 1-6) and the rows are the slices (slices 1-8). This is for one patient, and we are scanning several patients.
I want to organize the data such that it is easy to create visualizations such that I can compare different methods for all patients, or look at the values for the different slices, or simply look at specific segments.
If I use one dataframe, should each observation be a slice? Or a single value from a single slice and segment? Should I use multiple dataframes? I am a little lost on how to best organize this, as I've had no previous experience with datasets.
Thank you for your help, and if more clarification is needed, please let me know.
r dataframe
r dataframe
edited Nov 19 at 20:36
asked Nov 19 at 20:11
senidog
11
11
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 at 20:29
add a comment |
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 at 20:29
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 at 20:29
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 at 20:29
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You can flatten out the rows. So basically, you would have 48 (i.e. 6 x 8)
columns and as many rows as the number of patients.
This is rather a comment than an answer.
– Florian
Nov 19 at 20:30
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can flatten out the rows. So basically, you would have 48 (i.e. 6 x 8)
columns and as many rows as the number of patients.
This is rather a comment than an answer.
– Florian
Nov 19 at 20:30
add a comment |
up vote
0
down vote
You can flatten out the rows. So basically, you would have 48 (i.e. 6 x 8)
columns and as many rows as the number of patients.
This is rather a comment than an answer.
– Florian
Nov 19 at 20:30
add a comment |
up vote
0
down vote
up vote
0
down vote
You can flatten out the rows. So basically, you would have 48 (i.e. 6 x 8)
columns and as many rows as the number of patients.
You can flatten out the rows. So basically, you would have 48 (i.e. 6 x 8)
columns and as many rows as the number of patients.
answered Nov 19 at 20:24
pooja p
1097
1097
This is rather a comment than an answer.
– Florian
Nov 19 at 20:30
add a comment |
This is rather a comment than an answer.
– Florian
Nov 19 at 20:30
This is rather a comment than an answer.
– Florian
Nov 19 at 20:30
This is rather a comment than an answer.
– Florian
Nov 19 at 20:30
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53381945%2fwhich-data-structure-for-multidimensional-mri-data-multiple-methods-slices-se%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 at 20:29