From 8ca9e2802858678f227e33b5310616c9b37fa251 Mon Sep 17 00:00:00 2001 From: gurayerus Date: Sun, 15 Sep 2024 21:49:04 -0400 Subject: [PATCH] Add display of derived rois to the img viewer --- resources/MUSE/list_MUSE_all.csv | 261 ++++++++++++++++++ resources/MUSE/list_MUSE_composite.csv | 115 ++++++++ resources/MUSE/list_MUSE_mapping_derived.csv | 260 +++++++++++++++++ resources/MUSE/list_MUSE_primary.csv | 26 ++ resources/MUSE/list_MUSE_short.csv | 6 + resources/MUSE/list_MUSE_single.csv | 146 ++++++++++ src/NiChart_Viewer/src/pages/home.py | 21 +- src/NiChart_Viewer/src/pages/view_img.py | 66 ++++- .../src/pages/view_plot_data.py | 6 +- 9 files changed, 882 insertions(+), 25 deletions(-) create mode 100755 resources/MUSE/list_MUSE_all.csv create mode 100755 resources/MUSE/list_MUSE_composite.csv create mode 100755 resources/MUSE/list_MUSE_mapping_derived.csv create mode 100755 resources/MUSE/list_MUSE_primary.csv create mode 100755 resources/MUSE/list_MUSE_short.csv create mode 100755 resources/MUSE/list_MUSE_single.csv diff --git a/resources/MUSE/list_MUSE_all.csv b/resources/MUSE/list_MUSE_all.csv new file mode 100755 index 00000000..492ffe4c --- /dev/null +++ b/resources/MUSE/list_MUSE_all.csv @@ -0,0 +1,261 @@ +Index,Code,Name +702,MUSE_702,ICV +701,MUSE_701,TotalBrain +600,MUSE_600,CortCSF +601,MUSE_601,GM +604,MUSE_604,WM +606,MUSE_606,GM_L +607,MUSE_607,WM_L +613,MUSE_613,GM_R +614,MUSE_614,WM_R +501,MUSE_501,CorpusCallosum +502,MUSE_502,Cerebellum +503,MUSE_503,Deep_WM_GM +504,MUSE_504,Frontal +505,MUSE_505,Limbic +506,MUSE_506,Occipital +507,MUSE_507,Parietal +508,MUSE_508,Temporal +509,MUSE_509,Ventricles +510,MUSE_510,Cerebellum_L +511,MUSE_511,Deep_WM_GM_L +512,MUSE_512,Frontal_L +513,MUSE_513,Limbic_L +514,MUSE_514,Occipital_L +515,MUSE_515,Parietal_L +516,MUSE_516,Temporal_L +517,MUSE_517,Ventricle_L +518,MUSE_518,Cerebellum_R +519,MUSE_519,Deep_WM_GM_R +520,MUSE_520,Frontal_R +521,MUSE_521,Limbic_R +522,MUSE_522,Occipital_R +523,MUSE_523,Parietal_R +524,MUSE_524,Temporal_R +525,MUSE_525,Ventricle_R +401,MUSE_401,BasalGanglia +402,MUSE_402,Deep_GM +403,MUSE_403,Deep_WM +404,MUSE_404,Frontal_GM +405,MUSE_405,Frontal_WM +406,MUSE_406,Limbic_GM +407,MUSE_407,Occipital_GM +408,MUSE_408,Occipital_WM +409,MUSE_409,Parietal_GM +410,MUSE_410,Parietal_WM +411,MUSE_411,Temporal_GM +412,MUSE_412,Temporal_WM +413,MUSE_413,BasalGanglia_L +414,MUSE_414,Deep_GM_L +415,MUSE_415,Deep_WM_L +416,MUSE_416,Frontal_GM_L +417,MUSE_417,Frontal_WM_L +418,MUSE_418,Limbic_GM_L +419,MUSE_419,Occipital_GM_L +420,MUSE_420,Occipital_WM_L +421,MUSE_421,Parietal_GM_L +422,MUSE_422,Parietal_WM_L +423,MUSE_423,Temporal_GM_L +424,MUSE_424,Temporal_WM_L +425,MUSE_425,BasalGanglia_R +426,MUSE_426,Deep_GM_R +427,MUSE_427,Deep_WM_R +428,MUSE_428,Frontal_GM_R +429,MUSE_429,Frontal_WM_R +430,MUSE_430,Limbic_GM_R +431,MUSE_431,Occipital_GM_R +432,MUSE_432,Occipital_WM_R +433,MUSE_433,Parietal_GM_R +434,MUSE_434,Parietal_WM_R +435,MUSE_435,Temporal_GM_R +436,MUSE_436,Temporal_WM_R +301,MUSE_301,FrontalInferior_GM +302,MUSE_302,FrontalInsular_GM +303,MUSE_303,FrontalLateral_GM +304,MUSE_304,FrontalMedial_GM +305,MUSE_305,FrontalOpercular_GM +306,MUSE_306,LimbicCingulate_GM +307,MUSE_307,LimbicMedialTemporal_GM +308,MUSE_308,OccipitalInferior_GM +309,MUSE_309,OccipitalLateral_GM +310,MUSE_310,OccipitalMedial_GM +311,MUSE_311,ParietalLateral_GM +312,MUSE_312,ParietalMedial_GM +313,MUSE_313,TemporalInferior_GM +314,MUSE_314,TemporalLateral_GM +315,MUSE_315,TemporalSupraTemporal_GM +316,MUSE_316,FrontalInferior_GM_L +317,MUSE_317,FrontalInsular_GM_L +318,MUSE_318,FrontalLateral_GM_L +319,MUSE_319,FrontalMedial_GM_L +320,MUSE_320,FrontalOpercular_GM_L +321,MUSE_321,LimbicCingulate_GM_L +322,MUSE_322,LimbicMedialTemporal_GM_L +323,MUSE_323,OccipitalInferior_GM_L +324,MUSE_324,OccipitalLateral_GM_L +325,MUSE_325,OccipitalMedial_GM_L +326,MUSE_326,ParietalLateral_GM_L +327,MUSE_327,ParietalMedial_GM_L +328,MUSE_328,TemporalInferior_GM_L +329,MUSE_329,TemporalLateral_GM_L +330,MUSE_330,TemporalSupraTemporal_GM_L +331,MUSE_331,FrontalInferior_GM_R +332,MUSE_332,FrontalInsular_GM_R +333,MUSE_333,FrontalLateral_GM_R +334,MUSE_334,FrontalMedial_GM_R +335,MUSE_335,FrontalOpercular_GM_R +336,MUSE_336,LimbicCingulate_GM_R +337,MUSE_337,LimbicMedialTemporal_GM_R +338,MUSE_338,OccipitalInferior_GM_R +339,MUSE_339,OccipitalLateral_GM_R +340,MUSE_340,OccipitalMedial_GM_R +341,MUSE_341,ParietalLateral_GM_R +342,MUSE_342,ParietalMedial_GM_R +343,MUSE_343,TemporalInferior_GM_R +344,MUSE_344,TemporalLateral_GM_R +345,MUSE_345,TemporalSupraTemporal_GM_R +4,MUSE_4,3rdVentricle +11,MUSE_11,4thVentricle +23,MUSE_23,AccumbensArea_R +30,MUSE_30,AccumbensArea_L +31,MUSE_31,Amygdala_R +32,MUSE_32,Amygdala_L +35,MUSE_35,BrainStem +36,MUSE_36,Caudate_R +37,MUSE_37,Caudate_L +38,MUSE_38,CerebellumExterior_R +39,MUSE_39,CerebellumExterior_L +40,MUSE_40,Cerebellum_WM_R +41,MUSE_41,Cerebellum_WM_L +47,MUSE_47,Hippocampus_R +48,MUSE_48,Hippocampus_L +49,MUSE_49,InfLatVentricle_R +50,MUSE_50,InfLatVentricle_L +51,MUSE_51,LateralVentricle_R +52,MUSE_52,LateralVentricle_L +55,MUSE_55,Pallidum_R +56,MUSE_56,Pallidum_L +57,MUSE_57,Putamen_R +58,MUSE_58,Putamen_L +59,MUSE_59,ThalamusProper_R +60,MUSE_60,ThalamusProper_L +61,MUSE_61,VentralDC_R +62,MUSE_62,VentralDC_L +71,MUSE_71,CerebellarVermalLobules_1to5 +72,MUSE_72,CerebellarVermalLobules_6to7 +73,MUSE_73,CerebellarVermalLobules_8to10 +75,MUSE_75,BasalForebrain_L +76,MUSE_76,BasalForebrain_R +81,MUSE_81,Frontal_WM_R +82,MUSE_82,Frontal_WM_L +83,MUSE_83,Occipital_WM_R +84,MUSE_84,Occipital_WM_L +85,MUSE_85,Parietal_WM_R +86,MUSE_86,Parietal_WM_L +87,MUSE_87,Temporal_WM_R +88,MUSE_88,Temporal_WM_L +89,MUSE_89,Fornix_R +90,MUSE_90,Fornix_L +91,MUSE_91,AnteriorLimbInternalCapsule_R +92,MUSE_92,AnteriorLimbInternalCapsule_L +93,MUSE_93,PosteriorLimbInternalCapsuleIncCerebralPeduncle_R +94,MUSE_94,PosteriorLimbInternalCapsuleIncCerebralPeduncle_L +95,MUSE_95,CorpusCallosum +100,MUSE_100,AnteriorCingulateGyrus_R +101,MUSE_101,AnteriorCingulateGyrus_L +102,MUSE_102,AnteriorInsula_R +103,MUSE_103,AnteriorInsula_L +104,MUSE_104,AnteriorOrbitalGyrus_R +105,MUSE_105,AnteriorOrbitalGyrus_L +106,MUSE_106,AngularGyrus_R +107,MUSE_107,AngularGyrus_L +108,MUSE_108,CalcarineCortex_R +109,MUSE_109,CalcarineCortex_L +112,MUSE_112,CentralOperculum_R +113,MUSE_113,CentralOperculum_L +114,MUSE_114,Cuneus_R +115,MUSE_115,Cuneus_L +116,MUSE_116,EntorhinalArea_R +117,MUSE_117,EntorhinalArea_L +118,MUSE_118,FrontalOperculum_R +119,MUSE_119,FrontalOperculum_L +120,MUSE_120,FrontalPole_R +121,MUSE_121,FrontalPole_L +122,MUSE_122,FusiformGyrus_R +123,MUSE_123,FusiformGyrus_L +124,MUSE_124,GyrusRectus_R +125,MUSE_125,GyrusRectus_L +128,MUSE_128,InferiorOccipitalGyrus_R +129,MUSE_129,InferiorOccipitalGyrus_L +132,MUSE_132,InferiorTemporalGyrus_R +133,MUSE_133,InferiorTemporalGyrus_L +134,MUSE_134,LingualGyrus_R +135,MUSE_135,LingualGyrus_L +136,MUSE_136,LateralOrbitalGyrus_R +137,MUSE_137,LateralOrbitalGyrus_L +138,MUSE_138,MiddleCingulateGyrus_R +139,MUSE_139,MiddleCingulateGyrus_L +140,MUSE_140,MedialFrontalCortex_R +141,MUSE_141,MedialFrontalCortex_L +142,MUSE_142,MiddleFrontalGyrus_R +143,MUSE_143,MiddleFrontalGyrus_L +144,MUSE_144,MiddleOccipitalGyrus_R +145,MUSE_145,MiddleOccipitalGyrus_L +146,MUSE_146,MedialOrbitalGyrus_R +147,MUSE_147,MedialOrbitalGyrus_L +148,MUSE_148,PostcentralGyrusMedialSegment_R +149,MUSE_149,PostcentralGyrusMedialSegment_L +150,MUSE_150,PrecentralGyrusMedialSegment_R +151,MUSE_151,PrecentralGyrusMedialSegment_L +152,MUSE_152,SuperiorFrontalGyrusMedialSegment_R +153,MUSE_153,SuperiorFrontalGyrusMedialSegment_L +154,MUSE_154,MiddleTemporalGyrus_R +155,MUSE_155,MiddleTemporalGyrus_L +156,MUSE_156,OccipitalPole_R +157,MUSE_157,OccipitalPole_L +160,MUSE_160,OccipitalFusiformGyrus_R +161,MUSE_161,OccipitalFusiformGyrus_L +162,MUSE_162,OpercularPartInferiorFrontalGyrus_R +163,MUSE_163,OpercularPartInferiorFrontalGyrus_L +164,MUSE_164,OrbitalPartInferiorFrontalGyrus_R +165,MUSE_165,OrbitalPartInferiorFrontalGyrus_L +166,MUSE_166,PosteriorCingulateGyrus_R +167,MUSE_167,PosteriorCingulateGyrus_L +168,MUSE_168,Precuneus_R +169,MUSE_169,Precuneus_L +170,MUSE_170,ParahippocampalGyrus_R +171,MUSE_171,ParahippocampalGyrus_L +172,MUSE_172,PosteriorInsula_R +173,MUSE_173,PosteriorInsula_L +174,MUSE_174,ParietalOperculum_R +175,MUSE_175,ParietalOperculum_L +176,MUSE_176,PostcentralGyrus_R +177,MUSE_177,PostcentralGyrus_L +178,MUSE_178,PosteriorOrbitalGyrus_R +179,MUSE_179,PosteriorOrbitalGyrus_L +180,MUSE_180,PlanumPolare_R +181,MUSE_181,PlanumPolare_L +182,MUSE_182,PrecentralGyrus_R +183,MUSE_183,PrecentralGyrus_L +184,MUSE_184,PlanumTemporale_R +185,MUSE_185,PlanumTemporale_L +186,MUSE_186,SubcallosalArea_R +187,MUSE_187,SubcallosalArea_L +190,MUSE_190,SuperiorFrontalGyrus_R +191,MUSE_191,SuperiorFrontalGyrus_L +192,MUSE_192,SupplementaryMotorCortex_R +193,MUSE_193,SupplementaryMotorCortex_L +194,MUSE_194,SupramarginalGyrus_R +195,MUSE_195,SupramarginalGyrus_L +196,MUSE_196,SuperiorOccipitalGyrus_R +197,MUSE_197,SuperiorOccipitalGyrus_L +198,MUSE_198,Superior_parietalLobule_R +199,MUSE_199,Superior_parietalLobule_L +200,MUSE_200,SuperiorTemporalGyrus_R +201,MUSE_201,SuperiorTemporalGyrus_L +202,MUSE_202,TemporalPole_R +203,MUSE_203,TemporalPole_L +204,MUSE_204,TriangularPartInferiorFrontalGyrus_R +205,MUSE_205,TriangularPartInferiorFrontalGyrus_L +206,MUSE_206,TransverseTemporalGyrus_R +207,MUSE_207,TransverseTemporalGyrus_L diff --git a/resources/MUSE/list_MUSE_composite.csv b/resources/MUSE/list_MUSE_composite.csv new file mode 100755 index 00000000..1e06b927 --- /dev/null +++ b/resources/MUSE/list_MUSE_composite.csv @@ -0,0 +1,115 @@ +Index,Code,Name +702,MUSE_702,ICV +701,MUSE_701,TotalBrain +601,MUSE_601,GM +604,MUSE_604,WM +606,MUSE_606,GM_L +607,MUSE_607,WM_L +613,MUSE_613,GM_R +614,MUSE_614,WM_R +501,MUSE_501,CorpusCallosum +502,MUSE_502,Cerebellum +503,MUSE_503,Deep_WM_GM +504,MUSE_504,Frontal +505,MUSE_505,Limbic +506,MUSE_506,Occipital +507,MUSE_507,Parietal +508,MUSE_508,Temporal +509,MUSE_509,Ventricles +510,MUSE_510,Cerebellum_L +511,MUSE_511,Deep_WM_GM_L +512,MUSE_512,Frontal_L +513,MUSE_513,Limbic_L +514,MUSE_514,Occipital_L +515,MUSE_515,Parietal_L +516,MUSE_516,Temporal_L +517,MUSE_517,Ventricle_L +518,MUSE_518,Cerebellum_R +519,MUSE_519,Deep_WM_GM_R +520,MUSE_520,Frontal_R +521,MUSE_521,Limbic_R +522,MUSE_522,Occipital_R +523,MUSE_523,Parietal_R +524,MUSE_524,Temporal_R +525,MUSE_525,Ventricle_R +401,MUSE_401,BasalGanglia +402,MUSE_402,Deep_GM +403,MUSE_403,Deep_WM +404,MUSE_404,Frontal_GM +405,MUSE_405,Frontal_WM +406,MUSE_406,Limbic_GM +407,MUSE_407,Occipital_GM +408,MUSE_408,Occipital_WM +409,MUSE_409,Parietal_GM +410,MUSE_410,Parietal_WM +411,MUSE_411,Temporal_GM +412,MUSE_412,Temporal_WM +413,MUSE_413,BasalGanglia_L +414,MUSE_414,Deep_GM_L +415,MUSE_415,Deep_WM_L +416,MUSE_416,Frontal_GM_L +417,MUSE_417,Frontal_WM_L +418,MUSE_418,Limbic_GM_L +419,MUSE_419,Occipital_GM_L +420,MUSE_420,Occipital_WM_L +421,MUSE_421,Parietal_GM_L +422,MUSE_422,Parietal_WM_L +423,MUSE_423,Temporal_GM_L +424,MUSE_424,Temporal_WM_L +425,MUSE_425,BasalGanglia_R +426,MUSE_426,Deep_GM_R +427,MUSE_427,Deep_WM_R +428,MUSE_428,Frontal_GM_R +429,MUSE_429,Frontal_WM_R +430,MUSE_430,Limbic_GM_R +431,MUSE_431,Occipital_GM_R +432,MUSE_432,Occipital_WM_R +433,MUSE_433,Parietal_GM_R +434,MUSE_434,Parietal_WM_R +435,MUSE_435,Temporal_GM_R +436,MUSE_436,Temporal_WM_R +301,MUSE_301,FrontalInferior_GM +302,MUSE_302,FrontalInsular_GM +303,MUSE_303,FrontalLateral_GM +304,MUSE_304,FrontalMedial_GM +305,MUSE_305,FrontalOpercular_GM +306,MUSE_306,LimbicCingulate_GM +307,MUSE_307,LimbicMedialTemporal_GM +308,MUSE_308,OccipitalInferior_GM +309,MUSE_309,OccipitalLateral_GM +310,MUSE_310,OccipitalMedial_GM +311,MUSE_311,ParietalLateral_GM +312,MUSE_312,ParietalMedial_GM +313,MUSE_313,TemporalInferior_GM +314,MUSE_314,TemporalLateral_GM +315,MUSE_315,TemporalSupraTemporal_GM +316,MUSE_316,FrontalInferior_GM_L +317,MUSE_317,FrontalInsular_GM_L +318,MUSE_318,FrontalLateral_GM_L +319,MUSE_319,FrontalMedial_GM_L +320,MUSE_320,FrontalOpercular_GM_L +321,MUSE_321,LimbicCingulate_GM_L +322,MUSE_322,LimbicMedialTemporal_GM_L +323,MUSE_323,OccipitalInferior_GM_L +324,MUSE_324,OccipitalLateral_GM_L +325,MUSE_325,OccipitalMedial_GM_L +326,MUSE_326,ParietalLateral_GM_L +327,MUSE_327,ParietalMedial_GM_L +328,MUSE_328,TemporalInferior_GM_L +329,MUSE_329,TemporalLateral_GM_L +330,MUSE_330,TemporalSupraTemporal_GM_L +331,MUSE_331,FrontalInferior_GM_R +332,MUSE_332,FrontalInsular_GM_R +333,MUSE_333,FrontalLateral_GM_R +334,MUSE_334,FrontalMedial_GM_R +335,MUSE_335,FrontalOpercular_GM_R +336,MUSE_336,LimbicCingulate_GM_R +337,MUSE_337,LimbicMedialTemporal_GM_R +338,MUSE_338,OccipitalInferior_GM_R +339,MUSE_339,OccipitalLateral_GM_R +340,MUSE_340,OccipitalMedial_GM_R +341,MUSE_341,ParietalLateral_GM_R +342,MUSE_342,ParietalMedial_GM_R +343,MUSE_343,TemporalInferior_GM_R +344,MUSE_344,TemporalLateral_GM_R +345,MUSE_345,TemporalSupraTemporal_GM_R diff --git a/resources/MUSE/list_MUSE_mapping_derived.csv b/resources/MUSE/list_MUSE_mapping_derived.csv new file mode 100755 index 00000000..54ff05dc --- /dev/null +++ b/resources/MUSE/list_MUSE_mapping_derived.csv @@ -0,0 +1,260 @@ +702,ICV,1,4,11,23,30,31,32,35,36,37,38,39,40,41,46,47,48,49,50,51,52,55,56,57,58,59,60,61,62,71,72,73,75,76,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,100,101,102,103,104,105,106,107,108,109,112,113,114,115,116,117,118,119,120,121,122,123,124,125,128,129,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 +701,TOTALBRAIN,4,11,23,30,31,32,35,36,37,38,39,40,41,47,48,49,50,51,52,55,56,57,58,59,60,61,62,71,72,73,75,76,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,100,101,102,103,104,105,106,107,108,109,112,113,114,115,116,117,118,119,120,121,122,123,124,125,128,129,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 +600,Cortical_CSF,1 +601,GM,23,30,31,32,36,37,38,39,47,48,55,56,57,58,59,60,71,72,73,75,76,100,101,102,103,104,105,106,107,108,109,112,113,114,115,116,117,118,119,120,121,122,123,124,125,128,129,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 +604,WM,40,41,61,62,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95 +606,GM_L,30,32,37,39,48,56,58,60,75,101,103,105,107,109,113,115,117,119,121,123,125,129,133,135,137,139,141,143,145,147,149,151,153,155,157,161,163,165,167,169,171,173,175,177,179,181,183,185,187,191,193,195,197,199,201,203,205,207 +607,WM_L,41,62,82,84,86,88,90,92,94 +613,GM_R,23,31,36,38,47,55,57,59,76,100,102,104,106,108,112,114,116,118,120,122,124,128,132,134,136,138,140,142,144,146,148,150,152,154,156,160,162,164,166,168,170,172,174,176,178,180,182,184,186,190,192,194,196,198,200,202,204,206 +614,WM_R,40,61,81,83,85,87,89,91,93 +501,CORPUS_CALLOSUM,95 +502,CEREBELLUM,38,39,40,41,71,72,73 +503,DEEP_WM_GM,23,30,31,32,36,37,47,48,55,56,57,58,59,60,75,76,89,90,91,92,93,94 +504,FRONTAL,81,82,102,103,104,105,112,113,118,119,120,121,124,125,136,137,140,141,142,143,146,147,150,151,152,153,162,163,164,165,172,173,174,175,178,179,182,183,186,187,190,191,192,193,204,205 +505,LIMBIC,100,101,116,117,138,139,166,167,170,171 +506,OCCIPITAL,83,84,108,109,114,115,128,129,134,135,144,145,156,157,160,161,196,197 +507,PARIETAL,85,86,106,107,148,149,168,169,176,177,194,195,198,199 +508,TEMPORAL,87,88,122,123,132,133,154,155,180,181,184,185,200,201,202,203,206,207 +509,VENTRICLE,4,11,49,50,51,52 +510,CEREBELLUM_L,39,41 +511,DEEP_WM_GM_L,30,32,37,48,56,58,60,75,90,92,94 +512,FRONTAL_L,82,103,105,113,119,121,125,137,141,143,147,151,153,163,165,173,175,179,183,187,191,193,205 +513,LIMBIC_L,101,117,139,167,171 +514,OCCIPITAL_L,84,109,115,129,135,145,157,161,197 +515,PARIETAL_L,86,107,149,169,177,195,199 +516,TEMPORAL_L,88,123,133,155,181,185,201,203,207 +517,VENTRICLE_L,50,52 +518,CEREBELLUM_R,38,40 +519,DEEP_WM_GM_R,23,31,36,47,55,57,59,76,89,91,93 +520,FRONTAL_R,81,102,104,112,118,120,124,136,140,142,146,150,152,162,164,172,174,178,182,186,190,192,204 +521,LIMBIC_R,100,116,138,166,170 +522,OCCIPITAL_R,83,108,114,128,134,144,156,160,196 +523,PARIETAL_R,85,106,148,168,176,194,198 +524,TEMPORAL_R,87,122,132,154,180,184,200,202,206 +525,VENTRICLE_R,49,51 +401,BASAL_GANGLIA,23,30,36,37,55,56,57,58 +402,DEEP_GM,59,60 +403,DEEP_WM,89,90,91,92,93,94 +404,FRONTAL_GM,102,103,104,105,112,113,118,119,120,121,124,125,136,137,140,141,142,143,146,147,150,151,152,153,162,163,164,165,172,173,174,175,178,179,182,183,186,187,190,191,192,193,204,205 +405,FRONTAL_WM,81,82 +406,LIMBIC_GM,100,101,116,117,138,139,166,167,170,171 +407,OCCIPITAL_GM,108,109,114,115,128,129,134,135,144,145,156,157,160,161,196,197 +408,OCCIPITAL_WM,83,84 +409,PARIETAL_GM,106,107,148,149,168,169,176,177,194,195,198,199 +410,PARIETAL_WM,85,86 +411,TEMPORAL_GM,122,123,132,133,154,155,180,181,184,185,200,201,202,203,206,207 +412,TEMPORAL_WM,87,88 +413,BASAL_GANGLIA_L,30,37,56,58 +414,DEEP_GM_L,60 +415,DEEP_WM_L,90,92,94 +416,FRONTAL_GM_L,103,105,113,119,121,125,137,141,143,147,151,153,163,165,173,175,179,183,187,191,193,205 +417,FRONTAL_WM_L,82 +418,LIMBIC_GM_L,101,117,139,167,171 +419,OCCIPITAL_GM_L,109,115,129,135,145,157,161,197 +420,OCCIPITAL_WM_L,84 +421,PARIETAL_GM_L,107,149,169,177,195,199 +422,PARIETAL_WM_L,86 +423,TEMPORAL_GM_L,123,133,155,181,185,201,203,207 +424,TEMPORAL_WM_L,88 +425,BASAL_GANGLIA_R,23,36,55,57 +426,DEEP_GM_R,59 +427,DEEP_WM_R,89,91,93 +428,FRONTAL_GM_R,102,104,112,118,120,124,136,140,142,146,150,152,162,164,172,174,178,182,186,190,192,204 +429,FRONTAL_WM_R,81 +430,LIMBIC_GM_R,100,116,138,166,170 +431,OCCIPITAL_GM_R,108,114,128,134,144,156,160,196 +432,OCCIPITAL_WM_R,83 +433,PARIETAL_GM_R,106,148,168,176,194,198 +434,PARIETAL_WM_R,85 +435,TEMPORAL_GM_R,122,132,154,180,184,200,202,206 +436,TEMPORAL_WM_R,87 +301,FRONTAL_INFERIOR_GM,104,105,136,137,146,147,178,179 +302,FRONTAL_INSULAR_GM,102,103,172,173 +303,FRONTAL_LATERAL_GM,120,121,142,143,162,163,164,165,182,183,190,191,204,205 +304,FRONTAL_MEDIAL_GM,124,125,140,141,150,151,152,153,186,187,192,193 +305,FRONTAL_OPERCULAR_GM,112,113,118,119,174,175 +306,LIMBIC_CINGULATE_GM,100,101,138,139,166,167 +307,LIMBIC_MEDIALTEMPORAL_GM,116,117,170,171 +308,OCCIPITAL_INFERIOR_GM,160,161 +309,OCCIPITAL_LATERAL_GM,128,129,144,145,156,157,196,197 +310,OCCIPITAL_MEDIAL_GM,108,109,114,115,134,135 +311,PARIETAL_LATERAL_GM,106,107,176,177,194,195,198,199 +312,PARIETAL_MEDIAL_GM,148,149,168,169 +313,TEMPORAL_INFERIOR_GM,122,123 +314,TEMPORAL_LATERAL_GM,132,133,154,155,200,201,202,203 +315,TEMPORAL_SUPRATEMPORAL_GM,180,181,184,185,206,207 +316,FRONTAL_INFERIOR_GM_L,105,137,147,179 +317,FRONTAL_INSULAR_GM_L,103,173 +318,FRONTAL_LATERAL_GM_L,121,143,163,165,183,191,205 +319,FRONTAL_MEDIAL_GM_L,125,141,151,153,187,193 +320,FRONTAL_OPERCULAR_GM_L,113,119,175 +321,LIMBIC_CINGULATE_GM_L,101,139,167 +322,LIMBIC_MEDIALTEMPORAL_GM_L,117,171 +323,OCCIPITAL_INFERIOR_GM_L,161 +324,OCCIPITAL_LATERAL_GM_L,129,145,157,197 +325,OCCIPITAL_MEDIAL_GM_L,109,115,135 +326,PARIETAL_LATERAL_GM_L,107,177,195,199 +327,PARIETAL_MEDIAL_GM_L,149,169 +328,TEMPORAL_INFERIOR_GM_L,123 +329,TEMPORAL_LATERAL_GM_L,133,155,201,203 +330,TEMPORAL_SUPRATEMPORAL_GM_L,181,185,207 +331,FRONTAL_INFERIOR_GM_R,104,136,146,178 +332,FRONTAL_INSULAR_GM_R,102,172 +333,FRONTAL_LATERAL_GM_R,120,142,162,164,182,190,204 +334,FRONTAL_MEDIAL_GM_R,124,140,150,152,186,192 +335,FRONTAL_OPERCULAR_GM_R,112,118,174 +336,LIMBIC_CINGULATE_GM_R,100,138,166 +337,LIMBIC_MEDIALTEMPORAL_GM_R,116,170 +338,OCCIPITAL_INFERIOR_GM_R,160 +339,OCCIPITAL_LATERAL_GM_R,128,144,156,196 +340,OCCIPITAL_MEDIAL_GM_R,108,114,134 +341,PARIETAL_LATERAL_GM_R,106,176,194,198 +342,PARIETAL_MEDIAL_GM_R,148,168 +343,TEMPORAL_INFERIOR_GM_R,122 +344,TEMPORAL_LATERAL_GM_R,132,154,200,202 +345,TEMPORAL_SUPRATEMPORAL_GM_R,180,184,206 +4,3rd Ventricle,4 +11,4th Ventricle,11 +23,Right Accumbens Area,23 +30,Left Accumbens Area,30 +31,Right Amygdala,31 +32,Left Amygdala,32 +35,Brain Stem,35 +36,Right Caudate,36 +37,Left Caudate,37 +38,Right Cerebellum Exterior,38 +39,Left Cerebellum Exterior,39 +40,Right Cerebellum White Matter,40 +41,Left Cerebellum White Matter,41 +47,Right Hippocampus,47 +48,Left Hippocampus,48 +49,Right Inf Lat Vent,49 +50,Left Inf Lat Vent,50 +51,Right Lateral Ventricle,51 +52,Left Lateral Ventricle,52 +55,Right Pallidum,55 +56,Left Pallidum,56 +57,Right Putamen,57 +58,Left Putamen,58 +59,Right Thalamus Proper,59 +60,Left Thalamus Proper,60 +61,Right Ventral DC,61 +62,Left Ventral DC,62 +71,Cerebellar Vermal Lobules I-V,71 +72,Cerebellar Vermal Lobules VI-VII,72 +73,Cerebellar Vermal Lobules VIII-X,73 +75,Left Basal Forebrain,75 +76,Right Basal Forebrain,76 +81,frontal lobe WM right,81 +82,frontal lobe WM left,82 +83,occipital lobe WM right,83 +84,occipital lobe WM left,84 +85,parietal lobe WM right,85 +86,parietal lobe WM left,86 +87,temporal lobe WM right,87 +88,temporal lobe WM left,88 +89,fornix right,89 +90,fornix left,90 +91,anterior limb of internal capsule right,91 +92,anterior limb of internal capsule left,92 +93,posterior limb of internal capsule inc. cerebral peduncle right,93 +94,posterior limb of internal capsule inc. cerebral peduncle left,94 +95,corpus callosum,95 +100,Right ACgG anterior cingulate gyrus,100 +101,Left ACgG anterior cingulate gyrus,101 +102,Right AIns anterior insula,102 +103,Left AIns anterior insula,103 +104,Right AOrG anterior orbital gyrus,104 +105,Left AOrG anterior orbital gyrus,105 +106,Right AnG angular gyrus,106 +107,Left AnG angular gyrus,107 +108,Right Calc calcarine cortex,108 +109,Left Calc calcarine cortex,109 +112,Right CO central operculum,112 +113,Left CO central operculum,113 +114,Right Cun cuneus,114 +115,Left Cun cuneus,115 +116,Right Ent entorhinal area,116 +117,Left Ent entorhinal area,117 +118,Right FO frontal operculum,118 +119,Left FO frontal operculum,119 +120,Right FRP frontal pole,120 +121,Left FRP frontal pole,121 +122,Right FuG fusiform gyrus,122 +123,Left FuG fusiform gyrus,123 +124,Right GRe gyrus rectus,124 +125,Left GRe gyrus rectus,125 +128,Right IOG inferior occipital gyrus,128 +129,Left IOG inferior occipital gyrus,129 +132,Right ITG inferior temporal gyrus,132 +133,Left ITG inferior temporal gyrus,133 +134,Right LiG lingual gyrus,134 +135,Left LiG lingual gyrus,135 +136,Right LOrG lateral orbital gyrus,136 +137,Left LOrG lateral orbital gyrus,137 +138,Right MCgG middle cingulate gyrus,138 +139,Left MCgG middle cingulate gyrus,139 +140,Right MFC medial frontal cortex,140 +141,Left MFC medial frontal cortex,141 +142,Right MFG middle frontal gyrus,142 +143,Left MFG middle frontal gyrus,143 +144,Right MOG middle occipital gyrus,144 +145,Left MOG middle occipital gyrus,145 +146,Right MOrG medial orbital gyrus,146 +147,Left MOrG medial orbital gyrus,147 +148,Right MPoG postcentral gyrus medial segment,148 +149,Left MPoG postcentral gyrus medial segment,149 +150,Right MPrG precentral gyrus medial segment,150 +151,Left MPrG precentral gyrus medial segment,151 +152,Right MSFG superior frontal gyrus medial segment,152 +153,Left MSFG superior frontal gyrus medial segment,153 +154,Right MTG middle temporal gyrus,154 +155,Left MTG middle temporal gyrus,155 +156,Right OCP occipital pole,156 +157,Left OCP occipital pole,157 +160,Right OFuG occipital fusiform gyrus,160 +161,Left OFuG occipital fusiform gyrus,161 +162,Right OpIFG opercular part of the inferior frontal gyrus,162 +163,Left OpIFG opercular part of the inferior frontal gyrus,163 +164,Right OrIFG orbital part of the inferior frontal gyrus,164 +165,Left OrIFG orbital part of the inferior frontal gyrus,165 +166,Right PCgG posterior cingulate gyrus,166 +167,Left PCgG posterior cingulate gyrus,167 +168,Right PCu precuneus,168 +169,Left PCu precuneus,169 +170,Right PHG parahippocampal gyrus,170 +171,Left PHG parahippocampal gyrus,171 +172,Right PIns posterior insula,172 +173,Left PIns posterior insula,173 +174,Right PO parietal operculum,174 +175,Left PO parietal operculum,175 +176,Right PoG postcentral gyrus,176 +177,Left PoG postcentral gyrus,177 +178,Right POrG posterior orbital gyrus,178 +179,Left POrG posterior orbital gyrus,179 +180,Right PP planum polare,180 +181,Left PP planum polare,181 +182,Right PrG precentral gyrus,182 +183,Left PrG precentral gyrus,183 +184,Right PT planum temporale,184 +185,Left PT planum temporale,185 +186,Right SCA subcallosal area,186 +187,Left SCA subcallosal area,187 +190,Right SFG superior frontal gyrus,190 +191,Left SFG superior frontal gyrus,191 +192,Right SMC supplementary motor cortex,192 +193,Left SMC supplementary motor cortex,193 +194,Right SMG supramarginal gyrus,194 +195,Left SMG supramarginal gyrus,195 +196,Right SOG superior occipital gyrus,196 +197,Left SOG superior occipital gyrus,197 +198,Right SPL superior parietal lobule,198 +199,Left SPL superior parietal lobule,199 +200,Right STG superior temporal gyrus,200 +201,Left STG superior temporal gyrus,201 +202,Right TMP temporal pole,202 +203,Left TMP temporal pole,203 +204,Right TrIFG triangular part of the inferior frontal gyrus,204 +205,Left TrIFG triangular part of the inferior frontal gyrus,205 +206,Right TTG transverse temporal gyrus,206 +207,Left TTG transverse temporal gyrus,207 diff --git a/resources/MUSE/list_MUSE_primary.csv b/resources/MUSE/list_MUSE_primary.csv new file mode 100755 index 00000000..3bf24f30 --- /dev/null +++ b/resources/MUSE/list_MUSE_primary.csv @@ -0,0 +1,26 @@ +Index,Code,Name +702,MUSE_702,ICV +701,MUSE_701,TotalBrain +601,MUSE_601,GM +604,MUSE_604,WM +509,MUSE_509,Ventricles +501,MUSE_501,CorpusCallosum +502,MUSE_502,Cerebellum +503,MUSE_503,Deep_WM_GM +504,MUSE_504,Frontal +505,MUSE_505,Limbic +506,MUSE_506,Occipital +507,MUSE_507,Parietal +508,MUSE_508,Temporal +404,MUSE_404,Frontal_GM +411,MUSE_411,Temporal_GM +31,MUSE_31,Amygdala_R +32,MUSE_32,Amygdala_L +36,MUSE_36,Caudate_R +37,MUSE_37,Caudate_L +47,MUSE_47,Hippocampus_R +48,MUSE_48,Hippocampus_L +57,MUSE_57,Putamen_R +58,MUSE_58,Putamen_L +59,MUSE_59,ThalamusProper_R +60,MUSE_60,ThalamusProper_L diff --git a/resources/MUSE/list_MUSE_short.csv b/resources/MUSE/list_MUSE_short.csv new file mode 100755 index 00000000..b1facffa --- /dev/null +++ b/resources/MUSE/list_MUSE_short.csv @@ -0,0 +1,6 @@ +Index,Code,Name +702,MUSE_702,ICV +601,MUSE_601,GM +604,MUSE_604,WM +47,MUSE_47,Hippocampus_R +48,MUSE_48,Hippocampus_L diff --git a/resources/MUSE/list_MUSE_single.csv b/resources/MUSE/list_MUSE_single.csv new file mode 100755 index 00000000..dddd8834 --- /dev/null +++ b/resources/MUSE/list_MUSE_single.csv @@ -0,0 +1,146 @@ +Index,Code,Name +4,MUSE_4,3rdVentricle +11,MUSE_11,4thVentricle +23,MUSE_23,AccumbensArea_R +30,MUSE_30,AccumbensArea_L +31,MUSE_31,Amygdala_R +32,MUSE_32,Amygdala_L +35,MUSE_35,BrainStem +36,MUSE_36,Caudate_R +37,MUSE_37,Caudate_L +38,MUSE_38,CerebellumExterior_R +39,MUSE_39,CerebellumExterior_L +40,MUSE_40,Cerebellum_WM_R +41,MUSE_41,Cerebellum_WM_L +47,MUSE_47,Hippocampus_R +48,MUSE_48,Hippocampus_L +49,MUSE_49,InfLatVentricle_R +50,MUSE_50,InfLatVentricle_L +51,MUSE_51,LateralVentricle_R +52,MUSE_52,LateralVentricle_L +55,MUSE_55,Pallidum_R +56,MUSE_56,Pallidum_L +57,MUSE_57,Putamen_R +58,MUSE_58,Putamen_L +59,MUSE_59,ThalamusProper_R +60,MUSE_60,ThalamusProper_L +61,MUSE_61,VentralDC_R +62,MUSE_62,VentralDC_L +71,MUSE_71,CerebellarVermalLobules_1to5 +72,MUSE_72,CerebellarVermalLobules_6to7 +73,MUSE_73,CerebellarVermalLobules_8to10 +75,MUSE_75,BasalForebrain_L +76,MUSE_76,BasalForebrain_R +81,MUSE_81,Frontal_WM_R +82,MUSE_82,Frontal_WM_L +83,MUSE_83,Occipital_WM_R +84,MUSE_84,Occipital_WM_L +85,MUSE_85,Parietal_WM_R +86,MUSE_86,Parietal_WM_L +87,MUSE_87,Temporal_WM_R +88,MUSE_88,Temporal_WM_L +89,MUSE_89,Fornix_R +90,MUSE_90,Fornix_L +91,MUSE_91,AnteriorLimbInternalCapsule_R +92,MUSE_92,AnteriorLimbInternalCapsule_L +93,MUSE_93,PosteriorLimbInternalCapsuleIncCerebralPeduncle_R +94,MUSE_94,PosteriorLimbInternalCapsuleIncCerebralPeduncle_L +95,MUSE_95,CorpusCallosum +100,MUSE_100,AnteriorCingulateGyrus_R +101,MUSE_101,AnteriorCingulateGyrus_L +102,MUSE_102,AnteriorInsula_R +103,MUSE_103,AnteriorInsula_L +104,MUSE_104,AnteriorOrbitalGyrus_R +105,MUSE_105,AnteriorOrbitalGyrus_L +106,MUSE_106,AngularGyrus_R +107,MUSE_107,AngularGyrus_L +108,MUSE_108,CalcarineCortex_R +109,MUSE_109,CalcarineCortex_L +112,MUSE_112,CentralOperculum_R +113,MUSE_113,CentralOperculum_L +114,MUSE_114,Cuneus_R +115,MUSE_115,Cuneus_L +116,MUSE_116,EntorhinalArea_R +117,MUSE_117,EntorhinalArea_L +118,MUSE_118,FrontalOperculum_R +119,MUSE_119,FrontalOperculum_L +120,MUSE_120,FrontalPole_R +121,MUSE_121,FrontalPole_L +122,MUSE_122,FusiformGyrus_R +123,MUSE_123,FusiformGyrus_L +124,MUSE_124,GyrusRectus_R +125,MUSE_125,GyrusRectus_L +128,MUSE_128,InferiorOccipitalGyrus_R +129,MUSE_129,InferiorOccipitalGyrus_L +132,MUSE_132,InferiorTemporalGyrus_R +133,MUSE_133,InferiorTemporalGyrus_L +134,MUSE_134,LingualGyrus_R +135,MUSE_135,LingualGyrus_L +136,MUSE_136,LateralOrbitalGyrus_R +137,MUSE_137,LateralOrbitalGyrus_L +138,MUSE_138,MiddleCingulateGyrus_R +139,MUSE_139,MiddleCingulateGyrus_L +140,MUSE_140,MedialFrontalCortex_R +141,MUSE_141,MedialFrontalCortex_L +142,MUSE_142,MiddleFrontalGyrus_R +143,MUSE_143,MiddleFrontalGyrus_L +144,MUSE_144,MiddleOccipitalGyrus_R +145,MUSE_145,MiddleOccipitalGyrus_L +146,MUSE_146,MedialOrbitalGyrus_R +147,MUSE_147,MedialOrbitalGyrus_L +148,MUSE_148,PostcentralGyrusMedialSegment_R +149,MUSE_149,PostcentralGyrusMedialSegment_L +150,MUSE_150,PrecentralGyrusMedialSegment_R +151,MUSE_151,PrecentralGyrusMedialSegment_L +152,MUSE_152,SuperiorFrontalGyrusMedialSegment_R +153,MUSE_153,SuperiorFrontalGyrusMedialSegment_L +154,MUSE_154,MiddleTemporalGyrus_R +155,MUSE_155,MiddleTemporalGyrus_L +156,MUSE_156,OccipitalPole_R +157,MUSE_157,OccipitalPole_L +160,MUSE_160,OccipitalFusiformGyrus_R +161,MUSE_161,OccipitalFusiformGyrus_L +162,MUSE_162,OpercularPartInferiorFrontalGyrus_R +163,MUSE_163,OpercularPartInferiorFrontalGyrus_L +164,MUSE_164,OrbitalPartInferiorFrontalGyrus_R +165,MUSE_165,OrbitalPartInferiorFrontalGyrus_L +166,MUSE_166,PosteriorCingulateGyrus_R +167,MUSE_167,PosteriorCingulateGyrus_L +168,MUSE_168,Precuneus_R +169,MUSE_169,Precuneus_L +170,MUSE_170,ParahippocampalGyrus_R +171,MUSE_171,ParahippocampalGyrus_L +172,MUSE_172,PosteriorInsula_R +173,MUSE_173,PosteriorInsula_L +174,MUSE_174,ParietalOperculum_R +175,MUSE_175,ParietalOperculum_L +176,MUSE_176,PostcentralGyrus_R +177,MUSE_177,PostcentralGyrus_L +178,MUSE_178,PosteriorOrbitalGyrus_R +179,MUSE_179,PosteriorOrbitalGyrus_L +180,MUSE_180,PlanumPolare_R +181,MUSE_181,PlanumPolare_L +182,MUSE_182,PrecentralGyrus_R +183,MUSE_183,PrecentralGyrus_L +184,MUSE_184,PlanumTemporale_R +185,MUSE_185,PlanumTemporale_L +186,MUSE_186,SubcallosalArea_R +187,MUSE_187,SubcallosalArea_L +190,MUSE_190,SuperiorFrontalGyrus_R +191,MUSE_191,SuperiorFrontalGyrus_L +192,MUSE_192,SupplementaryMotorCortex_R +193,MUSE_193,SupplementaryMotorCortex_L +194,MUSE_194,SupramarginalGyrus_R +195,MUSE_195,SupramarginalGyrus_L +196,MUSE_196,SuperiorOccipitalGyrus_R +197,MUSE_197,SuperiorOccipitalGyrus_L +198,MUSE_198,Superior_parietalLobule_R +199,MUSE_199,Superior_parietalLobule_L +200,MUSE_200,SuperiorTemporalGyrus_R +201,MUSE_201,SuperiorTemporalGyrus_L +202,MUSE_202,TemporalPole_R +203,MUSE_203,TemporalPole_L +204,MUSE_204,TriangularPartInferiorFrontalGyrus_R +205,MUSE_205,TriangularPartInferiorFrontalGyrus_L +206,MUSE_206,TransverseTemporalGyrus_R +207,MUSE_207,TransverseTemporalGyrus_L diff --git a/src/NiChart_Viewer/src/pages/home.py b/src/NiChart_Viewer/src/pages/home.py index 0493c7bf..1895983e 100644 --- a/src/NiChart_Viewer/src/pages/home.py +++ b/src/NiChart_Viewer/src/pages/home.py @@ -26,27 +26,38 @@ # ID selected by user st.session_state.sel_id = '' + # ROI selected by user + st.session_state.sel_roi = '' + # Input fields for w_sMRI st.session_state.study_name = 'MyStudy' st.session_state.in_csv_MUSE = '' st.session_state.in_csv_Demog = '' - # # FIXME: set default values for easy run - # st.session_state.in_csv_MUSE = f'{st.session_state.dir_root}/test/test_input/test2_rois/Study1/Study1_DLMUSE.csv' - # st.session_state.in_csv_Demog = f'{st.session_state.dir_root}/test/test_input/test2_rois/Study1/Study1_Demog.csv' - - # FIXME: Set these variables when the images are loaded or computed + # FIXME: temp path for running fast + # Should be set as the images are created st.session_state.dir_t1img = st.session_state.dir_root + '/test/test_input/test3_nifti+roi' st.session_state.dir_dlmuse = st.session_state.dir_root + '/test/test_input/test3_nifti+roi' st.session_state.suffix_t1img = '_T1.nii.gz' st.session_state.suffix_dlmuse = '_T1_DLMUSE.nii.gz' + # MUSE dictionaries + st.session_state.dir_resources = os.path.join(st.session_state.dir_root, 'resources') + + st.session_state.list_MUSE_derived = os.path.join(st.session_state.dir_resources, 'MUSE', + 'list_MUSE_mapping_derived.csv') + st.session_state.list_MUSE_all = os.path.join(st.session_state.dir_resources, 'MUSE', + 'list_MUSE_all.csv') + # Path to out folder st.session_state.out_dir = '' # Input fields for plotting st.session_state.in_csv_sMRI = '' + ## FIXME : this is for quickly loading a test example + st.session_state.in_csv_sMRI = st.session_state.dir_root + '/test/test_input/test3_nifti+roi/sMRI_Results_n4.csv' + st.session_state.instantiated = True st.sidebar.image("../resources/nichart1.png") diff --git a/src/NiChart_Viewer/src/pages/view_img.py b/src/NiChart_Viewer/src/pages/view_img.py index f054cb67..85dfac76 100644 --- a/src/NiChart_Viewer/src/pages/view_img.py +++ b/src/NiChart_Viewer/src/pages/view_img.py @@ -21,8 +21,8 @@ # Parameters for viewer VIEWS = ["axial", "sagittal", "coronal"] -VIEW_AXES = [0, 1, 2] -VIEW_OTHER_AXES = [(1,2), (0,2), (0,1)] +VIEW_AXES = [0, 2, 1] +VIEW_OTHER_AXES = [(1,2), (0,1), (0,2)] MASK_COLOR = (0, 255, 0) # RGB format def reorient_nifti(nii_in, ref_orient = 'LPS'): @@ -94,8 +94,27 @@ def detect_mask_bounds(mask): except: # Could not detect masked region. Set center to image center mask_bounds[i,2] = mask.shape[i] // 2 + return mask_bounds +def read_derived_roi_list(list_derived): + ''' + Create a dictionary from derived roi list + ''' + + # Read list + df = pd.read_csv(list_derived, header=None) + + # Create dict + dict_out = {} + for i, tmp_ind in enumerate(df[0].values): + df_tmp = df[df[0] == tmp_ind].drop([0,1], axis =1) + sel_vals = df_tmp.T.dropna().astype(int).values.flatten() + dict_out[tmp_ind] = sel_vals + + return dict_out + + def show_nifti(img, view, sel_axis_bounds): ''' Displays the nifti img @@ -114,7 +133,7 @@ def show_nifti(img, view, sel_axis_bounds): st.image(img[:, slice_index, :], use_column_width = True) @st.cache_data -def prep_images(f_img, f_mask, sel_roi_ind): +def prep_images(f_img, f_mask, sel_roi_ind, dict_derived): ''' Read images from files and create 3D matrices for display ''' @@ -131,11 +150,18 @@ def prep_images(f_img, f_mask, sel_roi_ind): img = nii_img.get_fdata() mask = nii_mask.get_fdata() + # Convert image to uint + img = (img / img.max() * 255).astype(int) + # Crop image to ROIs and reshape img, mask = crop_image(img, mask) - # Select target roi - mask = (mask == sel_roi_ind).astype(int) + # Select target roi: derived roi + list_rois = dict_derived[sel_roi_ind] + mask = np.isin(mask, list_rois) + + # # Select target roi: single roi + # mask = (mask == sel_roi_ind).astype(int) # Merge image and mask img = np.stack((img,)*3, axis=-1) @@ -150,12 +176,17 @@ def prep_images(f_img, f_mask, sel_roi_ind): return img, mask, img_masked -# FIXME: This will be read from file -dict_roi = {'Ventricles':51, 'Hippocampus_R':100, 'Hippocampus_L':48} +# Read dataframe with data +df = pd.read_csv(st.session_state.fname_spare_csv) +# Create a dictionary of MUSE indices and names +df_muse = pd.read_csv(st.session_state.list_MUSE_all) +df_muse = df_muse[df_muse.Name.isin(df.columns)] +dict_roi = dict(zip(df_muse.Name, df_muse.Index)) + +# Read derived roi list and convert to a dict +dict_derived = read_derived_roi_list(st.session_state.list_MUSE_derived) -# Read dataframe with subject mrids -df = pd.read_csv(st.session_state.fname_subj_list) # Page controls in side bar with st.sidebar: @@ -170,14 +201,20 @@ def prep_images(f_img, f_mask, sel_roi_ind): else: sel_ind = df.MRID.tolist().index(sel_id) sel_type = '(user)' - sel_id = st.selectbox("Select Subject", df.MRID.tolist(), key=f"selbox_mrid", index = sel_ind) + sel_id = st.selectbox("Selected Subject", df.MRID.tolist(), key=f"selbox_mrid", index = sel_ind) # st.sidebar.warning('Selected subject: ' + mrid) st.warning(f'Selected {sel_type}: {sel_id}') - ## FIXME: read list of rois from dictionary - ## show the roi selected in the plot - sel_roi = st.selectbox("Select ROI", list(dict_roi.keys()), key=f"selbox_rois", index = 0) + # Selection of ROI + sel_roi = st.session_state.sel_roi + if sel_roi == '': + sel_ind = 0 + sel_type = '(auto)' + else: + sel_ind = df_muse.Name.tolist().index(sel_roi) + sel_type = '(user)' + sel_roi = st.selectbox("Selected ROI", list(dict_roi.keys()), key=f"selbox_rois", index = sel_ind) with st.container(border=True): @@ -192,7 +229,6 @@ def prep_images(f_img, f_mask, sel_roi_ind): if list_orient: st.write("Selected options:", list_orient) -sel_roi = st.session_state.sel_roi # Select roi index sel_roi_ind = dict_roi[sel_roi] @@ -205,7 +241,7 @@ def prep_images(f_img, f_mask, sel_roi_ind): if os.path.exists(f_img) & os.path.exists(f_mask): # Process image and mask to prepare final 3d matrix to display - img, mask, img_masked = prep_images(f_img, f_mask, sel_roi_ind) + img, mask, img_masked = prep_images(f_img, f_mask, sel_roi_ind, dict_derived) # Detect mask bounds and center in each view mask_bounds = detect_mask_bounds(mask) diff --git a/src/NiChart_Viewer/src/pages/view_plot_data.py b/src/NiChart_Viewer/src/pages/view_plot_data.py index 0e280e59..f750415b 100644 --- a/src/NiChart_Viewer/src/pages/view_plot_data.py +++ b/src/NiChart_Viewer/src/pages/view_plot_data.py @@ -205,10 +205,6 @@ def filter_dataframe(df: pd.DataFrame, pid) -> pd.DataFrame: return df -# # Config page -# st.set_page_config(page_title="DataFrame Demo", page_icon="📊", layout='wide') - -dir_root = os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))) # Page controls in side bar with st.sidebar: @@ -221,7 +217,7 @@ def filter_dataframe(df: pd.DataFrame, pid) -> pd.DataFrame: spare_csv = st.sidebar.text_input("Enter the name of the ROI csv file:", value = st.session_state.in_csv_sMRI, label_visibility="collapsed") - st.session_state.fname_subj_list = spare_csv + st.session_state.fname_spare_csv = spare_csv if os.path.exists(spare_csv):