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.










share|improve this question
























  • Please make your question more clear. stackoverflow.com/help/how-to-ask
    – Florian
    Nov 19 at 20:29















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.










share|improve this question
























  • Please make your question more clear. stackoverflow.com/help/how-to-ask
    – Florian
    Nov 19 at 20:29













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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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












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.






share|improve this answer





















  • This is rather a comment than an answer.
    – Florian
    Nov 19 at 20:30











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',
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
});


}
});














draft saved

draft discarded


















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








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.






share|improve this answer





















  • This is rather a comment than an answer.
    – Florian
    Nov 19 at 20:30















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.






share|improve this answer





















  • This is rather a comment than an answer.
    – Florian
    Nov 19 at 20:30













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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 19 at 20:24









pooja p

1097




1097












  • 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




This is rather a comment than an answer.
– Florian
Nov 19 at 20:30


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen