Spaces:
Sleeping
Sleeping
Nuking localhost for good
Browse files
static/assets/index-DBG8gcSd.js
CHANGED
|
@@ -124,4 +124,4 @@ Error generating stack: `+i.message+`
|
|
| 124 |
*
|
| 125 |
* This source code is licensed under the ISC license.
|
| 126 |
* See the LICENSE file in the root directory of this source tree.
|
| 127 |
-
*/const Ih=Ae("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);function Dh(){const[e,t]=S.useState(()=>localStorage.getItem("theme")||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"));return S.useEffect(()=>{const r=window.document.documentElement;r.classList.remove("light","dark"),r.classList.add(e),localStorage.setItem("theme",e)},[e]),{theme:e,toggleTheme:()=>{t(r=>r==="light"?"dark":"light")}}}function Fh(){const{theme:e,toggleTheme:t}=Dh();return v.jsx("button",{onClick:t,className:"p-2 rounded-lg bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors","aria-label":"Toggle theme",children:e==="dark"?v.jsx(Mh,{className:"w-5 h-5 text-yellow-500"}):v.jsx(Th,{className:"w-5 h-5 text-gray-700"})})}function Uh(){const e=sr();return v.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-md",children:v.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:v.jsxs("div",{className:"flex justify-between items-center h-16",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx(Ph,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"}),v.jsx("span",{className:"ml-2 text-xl font-semibold text-gray-900 dark:text-white",children:"NeuraScan"})]}),v.jsxs("div",{className:"flex items-center space-x-4",children:[v.jsxs("nav",{className:"flex space-x-4",children:[v.jsx(ga,{to:"/",className:`px-3 py-2 rounded-md text-sm font-medium ${e.pathname==="/"?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-200":"text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:"Classify"}),v.jsx(ga,{to:"/about",className:`px-3 py-2 rounded-md text-sm font-medium ${e.pathname==="/about"?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-200":"text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:"About"})]}),v.jsx(Fh,{})]})]})})})}function $h(){return v.jsx("footer",{className:"bg-white dark:bg-gray-800 shadow-md mt-auto",children:v.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:v.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0",children:[v.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"© All rights reserved to HUFE BME B59 G2 2024/2025"}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Lh,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),v.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Contact us:"}),v.jsx("a",{href:"mailto:mohamedasem318@gmail.com",className:"text-sm text-blue-600 dark:text-blue-400 hover:underline",children:"mohamedasem318@gmail.com"}),v.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"|"}),v.jsx("a",{href:"mailto:mohamed.sameh8103@gmail.com",className:"text-sm text-blue-600 dark:text-blue-400 hover:underline",children:"mohamed.sameh8103@gmail.com"})]})]})})})}function Qc(){return v.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-6",children:v.jsxs("div",{className:"flex items-start space-x-2",children:[v.jsx(Hc,{className:"h-5 w-5 text-blue-600 dark:text-blue-400 mt-0.5 flex-shrink-0"}),v.jsxs("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[v.jsx("strong",{children:"Disclaimer:"})," This tool is designed to assist medical professionals in their diagnostic process. It should not be used as the sole basis for medical decisions. Always consult with qualified healthcare providers for proper diagnosis and treatment."]})]})})}function Bh(){const e=[{name:"Fatma Al-Zahraa Emad",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/fatma.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/fatma-al-zahraa-emad-326b64234/"},{name:"Gehad Mohamed Roshdy",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/gehad.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/gehad-mohamed-2a4946252/"},{name:"Hebatullah El Gazoly",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/heba.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/hebatullah-elgazoly-308ab2243/"},{name:"Mohamed Assem Adel",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/asem.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/mohamedasem318/"},{name:"Mohamed Sameh Mohamed",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/sameh.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/muhamedsameh/"}];return v.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[v.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-8",children:"About NeuraScan"}),v.jsxs("div",{className:"space-y-8",children:[v.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[v.jsxs("div",{className:"flex items-center mb-4",children:[v.jsx(zh,{className:"h-6 w-6 text-blue-600 dark:text-blue-400 mr-2"}),v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Project Overview"})]}),v.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"NeuraScan is a state-of-the-art deep learning system designed to assist in the classification of brain MRI images for dementia assessment. Our advanced neural network achieves 96% accuracy in analyzing brain scans, providing medical professionals with reliable insights for their diagnostic workflow."})]}),v.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[v.jsxs("div",{className:"flex items-center mb-4",children:[v.jsx(jh,{className:"h-6 w-6 text-blue-600 dark:text-blue-400 mr-2"}),v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Classification Categories"})]}),v.jsxs("ul",{className:"space-y-3 text-gray-700 dark:text-gray-300",children:[v.jsx("li",{children:"• Non Demented - No significant signs of cognitive impairment"}),v.jsx("li",{children:"• Very Mild Demented - Early signs of cognitive decline"}),v.jsx("li",{children:"• Mild Demented - Moderate cognitive impairment"}),v.jsx("li",{children:"• Moderate Demented - Significant cognitive decline"}),v.jsx("li",{children:"• Unsure - Cases requiring further analysis"})]})]}),v.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[v.jsxs("div",{className:"flex items-center mb-6",children:[v.jsx(Ih,{className:"h-6 w-6 text-blue-600 dark:text-blue-400 mr-2"}),v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Meet the Innovators"})]}),v.jsxs("div",{className:"space-y-8",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"The Next Generation of Biomedical Innovation"}),v.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"As passionate biomedical engineering students from Helwan University's Faculty of Engineering (Batch 59, Group 2), we're bridging the gap between artificial intelligence and medical diagnostics. Our innovative team brings together expertise in machine learning, medical imaging, and healthcare technology."})]}),v.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-6",children:e.map(t=>v.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[v.jsxs("a",{href:t.linkedin,target:"_blank",rel:"noopener noreferrer",className:"relative group",children:[v.jsx("div",{className:"absolute inset-0 bg-blue-600 rounded-lg transform rotate-6 transition-transform group-hover:rotate-12"}),v.jsx("img",{src:t.image,alt:t.name,className:"relative w-32 h-32 object-cover rounded-lg transform transition-transform group-hover:-translate-y-1"})]}),v.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white text-center",children:t.name})]},t.name))}),v.jsx("div",{className:"grid md:grid-cols-2 gap-6 mt-8",children:v.jsxs("div",{children:[v.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Project Supervision"}),v.jsxs("ul",{className:"space-y-2 text-gray-700 dark:text-gray-300",children:[v.jsx("li",{children:"• Prof. Lamess Nasser"}),v.jsx("li",{children:"• Eng. Aya Shaaban"})]})]})})]})]}),v.jsx(Qc,{})]})]})}function Ah({onImageSelect:e,isProcessing:t}){const[n,r]=S.useState(!1),l=u=>{u.preventDefault(),u.stopPropagation(),u.type==="dragenter"||u.type==="dragover"?r(!0):u.type==="dragleave"&&r(!1)},i=u=>{u.preventDefault(),u.stopPropagation(),r(!1),u.dataTransfer.files&&u.dataTransfer.files[0]&&e(u.dataTransfer.files[0])},o=u=>{u.preventDefault(),u.target.files&&u.target.files[0]&&e(u.target.files[0])};return v.jsx("div",{className:"w-full max-w-2xl mx-auto",children:v.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center ${n?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}`,onDragEnter:l,onDragLeave:l,onDragOver:l,onDrop:i,children:[v.jsx("input",{type:"file",onChange:o,accept:".jpg,.jpeg,.png",className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:t}),v.jsxs("div",{className:"space-y-4",children:[v.jsx(Oh,{className:"mx-auto h-12 w-12 text-gray-400"}),v.jsxs("div",{className:"text-gray-700 dark:text-gray-300",children:[v.jsx("p",{className:"text-lg font-medium",children:"Drag and drop your MRI image here"}),v.jsx("p",{className:"text-sm",children:"or click to select a file"}),v.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Supported formats: JPG, PNG"})]})]})]})})}function Vh(){return v.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-8",children:[v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Important Notes for Image Upload"}),v.jsxs("div",{className:"space-y-6 text-gray-700 dark:text-gray-300",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"font-medium text-lg mb-2",children:"Supported Image Types:"}),v.jsxs("ul",{className:"list-disc list-inside space-y-2",children:[v.jsx("li",{children:"Axial (horizontal) brain MRI scans"}),v.jsx("li",{children:"Clear, high-contrast images"}),v.jsx("li",{children:"Only the brain is in the image (Skull is not included)"})]})]}),v.jsxs("div",{children:[v.jsx("h3",{className:"font-medium text-lg mb-2",children:"Image Requirements:"}),v.jsxs("ul",{className:"list-disc list-inside space-y-2",children:[v.jsx("li",{children:"File formats: JPG, PNG"}),v.jsx("li",{children:"Prefered Resolution: between 180x180 and 224x224 pixels"}),v.jsx("li",{children:"Maximum file size: 5MB"})]})]}),v.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Rh,{className:"w-5 h-5 text-green-500"}),v.jsx("h4",{className:"font-medium",children:"Supported Examples"})]}),v.jsx("div",{className:"space-y-4",children:v.jsx("img",{src:"https://www.researchgate.net/publication/384630960/figure/fig2/AS:11431281281953609@1728056089414/sual-depiction-of-standard-brain-MRI-samples-from-Kaggle.ppm",alt:"Supported MRI example",className:"w-full h-full object-cover rounded-lg border-2 border-green-200 dark:border-green-900"})})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Hc,{className:"w-5 h-5 text-red-500"}),v.jsx("h4",{className:"font-medium",children:"Not Supported Examples"})]}),v.jsx("div",{className:"space-y-4",children:v.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/MRI_of_Human_Brain.jpg/1200px-MRI_of_Human_Brain.jpg",alt:"Unsupported MRI example",className:"w-full h-full object-cover rounded-lg border-2 border-red-200 dark:border-red-900"})})]})]})]})]})}function Wh({result:e,confidence:t,isProcessing:n,selectedImage:r}){return!e&&!n&&!r?null:v.jsxs("div",{className:"mt-8 p-6 bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Classification Result"}),v.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r&&v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Uploaded Image"}),v.jsx("img",{src:URL.createObjectURL(r),alt:"Uploaded MRI scan",className:"w-full h-64 object-contain rounded-lg border-2 border-gray-200 dark:border-gray-700"})]}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Analysis"}),n?v.jsxs("div",{className:"flex items-center justify-center space-x-2 h-full",children:[v.jsx("div",{className:"w-4 h-4 bg-blue-600 rounded-full animate-pulse"}),v.jsx("div",{className:"w-4 h-4 bg-blue-600 rounded-full animate-pulse delay-150"}),v.jsx("div",{className:"w-4 h-4 bg-blue-600 rounded-full animate-pulse delay-300"}),v.jsx("span",{className:"ml-2 text-gray-700 dark:text-gray-300",children:"Processing image..."})]}):e&&v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Classification:"}),v.jsx("span",{className:`font-semibold ${e==="non demented"?"text-green-600 dark:text-green-400":e==="unsure"?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400"}`,children:e.charAt(0).toUpperCase()+e.slice(1)})]}),t!==null&&v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Confidence:"}),v.jsxs("span",{className:"font-semibold text-blue-600 dark:text-blue-400",children:[(t*100).toFixed(1),"%"]})]})]})]})]})]})}async function Hh(e){const t=new FormData;t.append("image",e);try{const n=await fetch("http://127.0.0.1:5000/api/classify",{method:"POST",body:t});if(!n.ok)throw new Error(`Server error: ${n.status} ${n.statusText}`);const r=await n.json();if(!r.result||typeof r.confidence!="number")throw new Error("Invalid response format from server");return{result:r.result,confidence:r.confidence}}catch(n){throw console.error("Classification error:",n),new Error(n instanceof Error?n.message:"Failed to connect to classification service")}}function Qh(){const[e,t]=S.useState(null),[n,r]=S.useState(!1),[l,i]=S.useState(null),[o,u]=S.useState(null),[a,s]=S.useState(null),h=async p=>{t(p),r(!0),s(null);try{const{result:m,confidence:y}=await Hh(p);i(m),u(y)}catch{s("Failed to process image. Please try again."),i(null),u(null)}finally{r(!1)}};return v.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[v.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-8",children:"Brain MRI Classification"}),v.jsx(Vh,{}),v.jsx(Ah,{onImageSelect:h,isProcessing:n}),a&&v.jsx("div",{className:"mt-4 p-4 bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-200 rounded-lg",children:a}),v.jsx(Wh,{result:l,confidence:o,isProcessing:n,selectedImage:e}),v.jsx("div",{className:"mt-8",children:v.jsx(Qc,{})})]})}function Kh(){return v.jsx(kh,{children:v.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",children:[v.jsx(Uh,{}),v.jsx("main",{className:"flex-grow",children:v.jsxs(hh,{children:[v.jsx(bi,{path:"/",element:v.jsx(Qh,{})}),v.jsx(bi,{path:"/about",element:v.jsx(Bh,{})})]})}),v.jsx($h,{})]})})}Tc(document.getElementById("root")).render(v.jsx(S.StrictMode,{children:v.jsx(Kh,{})}));
|
|
|
|
| 124 |
*
|
| 125 |
* This source code is licensed under the ISC license.
|
| 126 |
* See the LICENSE file in the root directory of this source tree.
|
| 127 |
+
*/const Ih=Ae("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);function Dh(){const[e,t]=S.useState(()=>localStorage.getItem("theme")||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"));return S.useEffect(()=>{const r=window.document.documentElement;r.classList.remove("light","dark"),r.classList.add(e),localStorage.setItem("theme",e)},[e]),{theme:e,toggleTheme:()=>{t(r=>r==="light"?"dark":"light")}}}function Fh(){const{theme:e,toggleTheme:t}=Dh();return v.jsx("button",{onClick:t,className:"p-2 rounded-lg bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors","aria-label":"Toggle theme",children:e==="dark"?v.jsx(Mh,{className:"w-5 h-5 text-yellow-500"}):v.jsx(Th,{className:"w-5 h-5 text-gray-700"})})}function Uh(){const e=sr();return v.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-md",children:v.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:v.jsxs("div",{className:"flex justify-between items-center h-16",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx(Ph,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"}),v.jsx("span",{className:"ml-2 text-xl font-semibold text-gray-900 dark:text-white",children:"NeuraScan"})]}),v.jsxs("div",{className:"flex items-center space-x-4",children:[v.jsxs("nav",{className:"flex space-x-4",children:[v.jsx(ga,{to:"/",className:`px-3 py-2 rounded-md text-sm font-medium ${e.pathname==="/"?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-200":"text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:"Classify"}),v.jsx(ga,{to:"/about",className:`px-3 py-2 rounded-md text-sm font-medium ${e.pathname==="/about"?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-200":"text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:"About"})]}),v.jsx(Fh,{})]})]})})})}function $h(){return v.jsx("footer",{className:"bg-white dark:bg-gray-800 shadow-md mt-auto",children:v.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:v.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0",children:[v.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"© All rights reserved to HUFE BME B59 G2 2024/2025"}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Lh,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),v.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Contact us:"}),v.jsx("a",{href:"mailto:mohamedasem318@gmail.com",className:"text-sm text-blue-600 dark:text-blue-400 hover:underline",children:"mohamedasem318@gmail.com"}),v.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"|"}),v.jsx("a",{href:"mailto:mohamed.sameh8103@gmail.com",className:"text-sm text-blue-600 dark:text-blue-400 hover:underline",children:"mohamed.sameh8103@gmail.com"})]})]})})})}function Qc(){return v.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-6",children:v.jsxs("div",{className:"flex items-start space-x-2",children:[v.jsx(Hc,{className:"h-5 w-5 text-blue-600 dark:text-blue-400 mt-0.5 flex-shrink-0"}),v.jsxs("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[v.jsx("strong",{children:"Disclaimer:"})," This tool is designed to assist medical professionals in their diagnostic process. It should not be used as the sole basis for medical decisions. Always consult with qualified healthcare providers for proper diagnosis and treatment."]})]})})}function Bh(){const e=[{name:"Fatma Al-Zahraa Emad",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/fatma.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/fatma-al-zahraa-emad-326b64234/"},{name:"Gehad Mohamed Roshdy",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/gehad.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/gehad-mohamed-2a4946252/"},{name:"Hebatullah El Gazoly",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/heba.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/hebatullah-elgazoly-308ab2243/"},{name:"Mohamed Assem Adel",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/asem.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/mohamedasem318/"},{name:"Mohamed Sameh Mohamed",image:"https://github.com/mohamedsameh108/NeuroScan-Website/blob/main/assets/images/team/sameh.jpg?raw=true?auto=format&fit=crop&w=300&q=80",linkedin:"https://www.linkedin.com/in/muhamedsameh/"}];return v.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[v.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-8",children:"About NeuraScan"}),v.jsxs("div",{className:"space-y-8",children:[v.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[v.jsxs("div",{className:"flex items-center mb-4",children:[v.jsx(zh,{className:"h-6 w-6 text-blue-600 dark:text-blue-400 mr-2"}),v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Project Overview"})]}),v.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"NeuraScan is a state-of-the-art deep learning system designed to assist in the classification of brain MRI images for dementia assessment. Our advanced neural network achieves 96% accuracy in analyzing brain scans, providing medical professionals with reliable insights for their diagnostic workflow."})]}),v.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[v.jsxs("div",{className:"flex items-center mb-4",children:[v.jsx(jh,{className:"h-6 w-6 text-blue-600 dark:text-blue-400 mr-2"}),v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Classification Categories"})]}),v.jsxs("ul",{className:"space-y-3 text-gray-700 dark:text-gray-300",children:[v.jsx("li",{children:"• Non Demented - No significant signs of cognitive impairment"}),v.jsx("li",{children:"• Very Mild Demented - Early signs of cognitive decline"}),v.jsx("li",{children:"• Mild Demented - Moderate cognitive impairment"}),v.jsx("li",{children:"• Moderate Demented - Significant cognitive decline"}),v.jsx("li",{children:"• Unsure - Cases requiring further analysis"})]})]}),v.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6",children:[v.jsxs("div",{className:"flex items-center mb-6",children:[v.jsx(Ih,{className:"h-6 w-6 text-blue-600 dark:text-blue-400 mr-2"}),v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Meet the Innovators"})]}),v.jsxs("div",{className:"space-y-8",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"The Next Generation of Biomedical Innovation"}),v.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"As passionate biomedical engineering students from Helwan University's Faculty of Engineering (Batch 59, Group 2), we're bridging the gap between artificial intelligence and medical diagnostics. Our innovative team brings together expertise in machine learning, medical imaging, and healthcare technology."})]}),v.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-6",children:e.map(t=>v.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[v.jsxs("a",{href:t.linkedin,target:"_blank",rel:"noopener noreferrer",className:"relative group",children:[v.jsx("div",{className:"absolute inset-0 bg-blue-600 rounded-lg transform rotate-6 transition-transform group-hover:rotate-12"}),v.jsx("img",{src:t.image,alt:t.name,className:"relative w-32 h-32 object-cover rounded-lg transform transition-transform group-hover:-translate-y-1"})]}),v.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white text-center",children:t.name})]},t.name))}),v.jsx("div",{className:"grid md:grid-cols-2 gap-6 mt-8",children:v.jsxs("div",{children:[v.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Project Supervision"}),v.jsxs("ul",{className:"space-y-2 text-gray-700 dark:text-gray-300",children:[v.jsx("li",{children:"• Prof. Lamess Nasser"}),v.jsx("li",{children:"• Eng. Aya Shaaban"})]})]})})]})]}),v.jsx(Qc,{})]})]})}function Ah({onImageSelect:e,isProcessing:t}){const[n,r]=S.useState(!1),l=u=>{u.preventDefault(),u.stopPropagation(),u.type==="dragenter"||u.type==="dragover"?r(!0):u.type==="dragleave"&&r(!1)},i=u=>{u.preventDefault(),u.stopPropagation(),r(!1),u.dataTransfer.files&&u.dataTransfer.files[0]&&e(u.dataTransfer.files[0])},o=u=>{u.preventDefault(),u.target.files&&u.target.files[0]&&e(u.target.files[0])};return v.jsx("div",{className:"w-full max-w-2xl mx-auto",children:v.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center ${n?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}`,onDragEnter:l,onDragLeave:l,onDragOver:l,onDrop:i,children:[v.jsx("input",{type:"file",onChange:o,accept:".jpg,.jpeg,.png",className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:t}),v.jsxs("div",{className:"space-y-4",children:[v.jsx(Oh,{className:"mx-auto h-12 w-12 text-gray-400"}),v.jsxs("div",{className:"text-gray-700 dark:text-gray-300",children:[v.jsx("p",{className:"text-lg font-medium",children:"Drag and drop your MRI image here"}),v.jsx("p",{className:"text-sm",children:"or click to select a file"}),v.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Supported formats: JPG, PNG"})]})]})]})})}function Vh(){return v.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-8",children:[v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Important Notes for Image Upload"}),v.jsxs("div",{className:"space-y-6 text-gray-700 dark:text-gray-300",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"font-medium text-lg mb-2",children:"Supported Image Types:"}),v.jsxs("ul",{className:"list-disc list-inside space-y-2",children:[v.jsx("li",{children:"Axial (horizontal) brain MRI scans"}),v.jsx("li",{children:"Clear, high-contrast images"}),v.jsx("li",{children:"Only the brain is in the image (Skull is not included)"})]})]}),v.jsxs("div",{children:[v.jsx("h3",{className:"font-medium text-lg mb-2",children:"Image Requirements:"}),v.jsxs("ul",{className:"list-disc list-inside space-y-2",children:[v.jsx("li",{children:"File formats: JPG, PNG"}),v.jsx("li",{children:"Prefered Resolution: between 180x180 and 224x224 pixels"}),v.jsx("li",{children:"Maximum file size: 5MB"})]})]}),v.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Rh,{className:"w-5 h-5 text-green-500"}),v.jsx("h4",{className:"font-medium",children:"Supported Examples"})]}),v.jsx("div",{className:"space-y-4",children:v.jsx("img",{src:"https://www.researchgate.net/publication/384630960/figure/fig2/AS:11431281281953609@1728056089414/sual-depiction-of-standard-brain-MRI-samples-from-Kaggle.ppm",alt:"Supported MRI example",className:"w-full h-full object-cover rounded-lg border-2 border-green-200 dark:border-green-900"})})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Hc,{className:"w-5 h-5 text-red-500"}),v.jsx("h4",{className:"font-medium",children:"Not Supported Examples"})]}),v.jsx("div",{className:"space-y-4",children:v.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/MRI_of_Human_Brain.jpg/1200px-MRI_of_Human_Brain.jpg",alt:"Unsupported MRI example",className:"w-full h-full object-cover rounded-lg border-2 border-red-200 dark:border-red-900"})})]})]})]})]})}function Wh({result:e,confidence:t,isProcessing:n,selectedImage:r}){return!e&&!n&&!r?null:v.jsxs("div",{className:"mt-8 p-6 bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[v.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"Classification Result"}),v.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r&&v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Uploaded Image"}),v.jsx("img",{src:URL.createObjectURL(r),alt:"Uploaded MRI scan",className:"w-full h-64 object-contain rounded-lg border-2 border-gray-200 dark:border-gray-700"})]}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Analysis"}),n?v.jsxs("div",{className:"flex items-center justify-center space-x-2 h-full",children:[v.jsx("div",{className:"w-4 h-4 bg-blue-600 rounded-full animate-pulse"}),v.jsx("div",{className:"w-4 h-4 bg-blue-600 rounded-full animate-pulse delay-150"}),v.jsx("div",{className:"w-4 h-4 bg-blue-600 rounded-full animate-pulse delay-300"}),v.jsx("span",{className:"ml-2 text-gray-700 dark:text-gray-300",children:"Processing image..."})]}):e&&v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Classification:"}),v.jsx("span",{className:`font-semibold ${e==="non demented"?"text-green-600 dark:text-green-400":e==="unsure"?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400"}`,children:e.charAt(0).toUpperCase()+e.slice(1)})]}),t!==null&&v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Confidence:"}),v.jsxs("span",{className:"font-semibold text-blue-600 dark:text-blue-400",children:[(t*100).toFixed(1),"%"]})]})]})]})]})]})}async function Hh(e){const t=new FormData;t.append("image",e);try{const n=await fetch("/api/classify",{method:"POST",body:t});if(!n.ok)throw new Error(`Server error: ${n.status} ${n.statusText}`);const r=await n.json();if(!r.result||typeof r.confidence!="number")throw new Error("Invalid response format from server");return{result:r.result,confidence:r.confidence}}catch(n){throw console.error("Classification error:",n),new Error(n instanceof Error?n.message:"Failed to connect to classification service")}}function Qh(){const[e,t]=S.useState(null),[n,r]=S.useState(!1),[l,i]=S.useState(null),[o,u]=S.useState(null),[a,s]=S.useState(null),h=async p=>{t(p),r(!0),s(null);try{const{result:m,confidence:y}=await Hh(p);i(m),u(y)}catch{s("Failed to process image. Please try again."),i(null),u(null)}finally{r(!1)}};return v.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[v.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-8",children:"Brain MRI Classification"}),v.jsx(Vh,{}),v.jsx(Ah,{onImageSelect:h,isProcessing:n}),a&&v.jsx("div",{className:"mt-4 p-4 bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-200 rounded-lg",children:a}),v.jsx(Wh,{result:l,confidence:o,isProcessing:n,selectedImage:e}),v.jsx("div",{className:"mt-8",children:v.jsx(Qc,{})})]})}function Kh(){return v.jsx(kh,{children:v.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",children:[v.jsx(Uh,{}),v.jsx("main",{className:"flex-grow",children:v.jsxs(hh,{children:[v.jsx(bi,{path:"/",element:v.jsx(Qh,{})}),v.jsx(bi,{path:"/about",element:v.jsx(Bh,{})})]})}),v.jsx($h,{})]})})}Tc(document.getElementById("root")).render(v.jsx(S.StrictMode,{children:v.jsx(Kh,{})}));
|