Which data structure for multidimensional MRI data (multiple methods, slices, segments) in R?
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 |
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 '18 at 20:29
add a comment |
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 '18 at 20:36
senidog
asked Nov 19 '18 at 20:11
senidogsenidog
11
11
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 '18 at 20:29
add a comment |
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 '18 at 20:29
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 '18 at 20:29
Please make your question more clear. stackoverflow.com/help/how-to-ask
– Florian
Nov 19 '18 at 20:29
add a comment |
1 Answer
1
active
oldest
votes
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 '18 at 20:30
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 '18 at 20:30
add a comment |
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 '18 at 20:30
add a comment |
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 '18 at 20:24
pooja ppooja p
1297
1297
This is rather a comment than an answer.
– Florian
Nov 19 '18 at 20:30
add a comment |
This is rather a comment than an answer.
– Florian
Nov 19 '18 at 20:30
This is rather a comment than an answer.
– Florian
Nov 19 '18 at 20:30
This is rather a comment than an answer.
– Florian
Nov 19 '18 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.
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 '18 at 20:29