Which data structure for multidimensional MRI data (multiple methods, slices, segments) in R?












0















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 '18 at 20:29
















0















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 '18 at 20:29














0












0








0








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 '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



















  • 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












1 Answer
1






active

oldest

votes


















0














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


}
});














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









0














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 '18 at 20:30
















0














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 '18 at 20:30














0












0








0







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 '18 at 20:24









pooja ppooja p

1297




1297













  • 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





This is rather a comment than an answer.

– Florian
Nov 19 '18 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.




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

鏡平學校

ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

Guess what letter conforming each word