commit dcc172b4655626956d3a32a82f6d4bf20bdf638d
Author: root <root@hub.scroll.pub> Date: 2025-01-13 17:57:27 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..20cd202 --- /dev/null +++ b/body.html @@ -0,0 +1,64 @@ +<header> + <nav> + <div class="logo">MRI Enhancement Suite</div> + <div class="nav-links"> + <a href="#upload">Upload</a> + <a href="#models">Models</a> + <a href="#about">About</a> + </div> + </nav> +</header> + +<main> + <section class="hero"> + <h1>Advanced MRI Image Enhancement</h1> + <p>Transform and enhance your neuroimaging data with AI-powered solutions</p> + </section> + + <section id="upload" class="upload-section"> + <h2>Upload Images</h2> + <div class="upload-container"> + <div class="upload-box" id="t1-upload"> + <label for="t1-input">T1-weighted Image (NII)</label> + <input type="file" id="t1-input" accept=".nii,.nii.gz" aria-label="Upload T1 weighted image"> + <div class="preview" id="t1-preview"> + <p>No file selected</p> + </div> + </div> + + <div class="upload-box" id="t2-upload"> + <label for="t2-input">T2-weighted Image (NII)</label> + <input type="file" id="t2-input" accept=".nii,.nii.gz" aria-label="Upload T2 weighted image"> + <div class="preview" id="t2-preview"> + <p>No file selected</p> + </div> + </div> + </div> + + <div class="model-selection"> + <h3>Select Enhancement Model</h3> + <select id="model-select" aria-label="Select enhancement model"> + <option value="motion-correction">Motion Correction (T2w)</option> + <option value="t2-synthesis" disabled>T2w Synthesis (Coming Soon)</option> + <option value="super-resolution" disabled>Super Resolution (Coming Soon)</option> + </select> + </div> + + <button id="process-btn" class="process-button" aria-label="Process images"> + Process Images + </button> + + <div class="results-container" id="results"> + <h3>Results</h3> + <div class="result-preview"> + <div id="output-preview"> + <p>Results will appear here</p> + </div> + </div> + </div> + </section> +</main> + +<footer> + <p>MRI Enhancement Suite | Advanced Neuroimaging Tools</p> +</footer> diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..0cbe4b7 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://mrienhance.scroll.pub +metaTags +editButton /edit.html +title MRI Enhancement Suite +style.css +body.html +script.js diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..1013f42 --- /dev/null +++ b/prompt.json @@ -0,0 +1,20 @@ +{ + "id": "msg_01FK4rjhnmSg8YopgpTjXLfP", + "type": "message", + "role": "assistant", + "model": "claude-3-5-sonnet-20241022", + "content": [ + { + "type": "text", + "text": "I'll create a professional webapp for MRI image enhancement. For the domain, I suggest:\n\n---domain---\nmrienhance.scroll.pub\n\n---index.scroll---\nbuildHtml\nbaseUrl https://mrienhance.scroll.pub\nmetaTags\neditButton /edit.html\ntitle MRI Enhancement Suite\nstyle.css\nbody.html\nscript.js\n\n---body.html---\n<header>\n <nav>\n <div class=\"logo\">MRI Enhancement Suite</div>\n <div class=\"nav-links\">\n <a href=\"#upload\">Upload</a>\n <a href=\"#models\">Models</a>\n <a href=\"#about\">About</a>\n </div>\n </nav>\n</header>\n\n<main>\n <section class=\"hero\">\n <h1>Advanced MRI Image Enhancement</h1>\n <p>Transform and enhance your neuroimaging data with AI-powered solutions</p>\n </section>\n\n <section id=\"upload\" class=\"upload-section\">\n <h2>Upload Images</h2>\n <div class=\"upload-container\">\n <div class=\"upload-box\" id=\"t1-upload\">\n <label for=\"t1-input\">T1-weighted Image (NII)</label>\n <input type=\"file\" id=\"t1-input\" accept=\".nii,.nii.gz\" aria-label=\"Upload T1 weighted image\">\n <div class=\"preview\" id=\"t1-preview\">\n <p>No file selected</p>\n </div>\n </div>\n \n <div class=\"upload-box\" id=\"t2-upload\">\n <label for=\"t2-input\">T2-weighted Image (NII)</label>\n <input type=\"file\" id=\"t2-input\" accept=\".nii,.nii.gz\" aria-label=\"Upload T2 weighted image\">\n <div class=\"preview\" id=\"t2-preview\">\n <p>No file selected</p>\n </div>\n </div>\n </div>\n\n <div class=\"model-selection\">\n <h3>Select Enhancement Model</h3>\n <select id=\"model-select\" aria-label=\"Select enhancement model\">\n <option value=\"motion-correction\">Motion Correction (T2w)</option>\n <option value=\"t2-synthesis\" disabled>T2w Synthesis (Coming Soon)</option>\n <option value=\"super-resolution\" disabled>Super Resolution (Coming Soon)</option>\n </select>\n </div>\n\n <button id=\"process-btn\" class=\"process-button\" aria-label=\"Process images\">\n Process Images\n </button>\n\n <div class=\"results-container\" id=\"results\">\n <h3>Results</h3>\n <div class=\"result-preview\">\n <div id=\"output-preview\">\n <p>Results will appear here</p>\n </div>\n </div>\n </div>\n </section>\n</main>\n\n<footer>\n <p>MRI Enhancement Suite | Advanced Neuroimaging Tools</p>\n</footer>\n\n---style.css---\n:root {\n --primary-color: #2a4365;\n --secondary-color: #4299e1;\n --background-color: #f7fafc;\n --text-color: #2d3748;\n --border-radius: 8px;\n --transition: all 0.3s ease;\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.6;\n color: var(--text-color);\n background: var(--background-color);\n}\n\nheader {\n background: var(--primary-color);\n padding: 1rem;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n\nnav {\n max-width: 1200px;\n margin: 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.logo {\n color: white;\n font-size: 1.5rem;\n font-weight: bold;\n}\n\n.nav-links a {\n color: white;\n text-decoration: none;\n margin-left: 2rem;\n transition: var(--transition);\n}\n\n.nav-links a:hover {\n color: var(--secondary-color);\n}\n\n.hero {\n text-align: center;\n padding: 4rem 2rem;\n background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));\n color: white;\n}\n\n.hero h1 {\n font-size: 2.5rem;\n margin-bottom: 1rem;\n}\n\n.upload-section {\n max-width: 1200px;\n margin: 2rem auto;\n padding: 2rem;\n}\n\n.upload-container {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n gap: 2rem;\n margin: 2rem 0;\n}\n\n.upload-box {\n background: white;\n padding: 2rem;\n border-radius: var(--border-radius);\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n transition: var(--transition);\n}\n\n.upload-box:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 8px rgba(0,0,0,0.15);\n}\n\n.upload-box label {\n display: block;\n margin-bottom: 1rem;\n font-weight: bold;\n}\n\n.upload-box input[type=\"file\"] {\n width: 100%;\n padding: 0.5rem;\n border: 2px dashed var(--secondary-color);\n border-radius: var(--border-radius);\n cursor: pointer;\n}\n\n.preview {\n margin-top: 1rem;\n min-height: 200px;\n background: var(--background-color);\n border-radius: var(--border-radius);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\n.model-selection {\n margin: 2rem 0;\n}\n\nselect {\n width: 100%;\n padding: 0.8rem;\n border-radius: var(--border-radius);\n border: 1px solid var(--secondary-color);\n background: white;\n margin-top: 1rem;\n}\n\n.process-button {\n display: block;\n width: 100%;\n padding: 1rem;\n background: var(--secondary-color);\n color: white;\n border: none;\n border-radius: var(--border-radius);\n font-size: 1.1rem;\n cursor: pointer;\n transition: var(--transition);\n}\n\n.process-button:hover {\n background: var(--primary-color);\n transform: translateY(-1px);\n}\n\n.results-container {\n margin-top: 2rem;\n padding: 2rem;\n background: white;\n border-radius: var(--border-radius);\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n}\n\nfooter {\n background: var(--primary-color);\n color: white;\n text-align: center;\n padding: 1rem;\n margin-top: 2rem;\n}\n\n@media (max-width: 768px) {\n .nav-links {\n display: none;\n }\n \n .hero h1 {\n font-size: 2rem;\n }\n \n .upload-section {\n padding: 1rem;\n }\n \n .upload-container {\n grid-template-columns: 1fr;\n }\n}\n\n---script.js---\ndocument.addEventListener('DOMContentLoaded', function() {\n const t1Input = document.getElementById('t1-input');\n const t2Input = document.getElementById('t2-input');\n const t1Preview = document.getElementById('t1-preview');\n const t2Preview = document.getElementById('t2-preview');\n const processBtn = document.getElementById('process-btn');\n const outputPreview = document.getElementById('output-preview');\n \n function updatePreview(file, previewElement) {\n if (file) {\n previewElement.innerHTML = `\n <div class=\"file-info\">\n <p><strong>File:</strong> ${file.name}</p>\n <p><strong>Size:</strong> ${(file.size / 1024 / 1024).toFixed(2)} MB</p>\n </div>\n `;\n } else {\n previewElement.innerHTML = '<p>No file selected</p>';\n }\n }\n\n t1Input.addEventListener('change', (e) => {\n updatePreview(e.target.files[0], t1Preview);\n });\n\n t2Input.addEventListener('change', (e) => {\n updatePreview(e.target.files[0], t2Preview);\n });\n\n processBtn.addEventListener('click', async () => {\n if (!t1Input.files[0] || !t2Input.files[0]) {\n alert('Please upload both T1 and T2 images');\n return;\n }\n\n processBtn.disabled = true;\n processBtn.textContent = 'Processing...';\n\n try {\n // Simulate processing delay\n await new Promise(resolve => setTimeout(resolve, 2000));\n \n outputPreview.innerHTML = `\n <div class=\"success-message\">\n <h4>Processing Complete!</h4>\n <p>Enhanced T2w image generated successfully.</p>\n <button class=\"process-button\" onclick=\"alert('Download starting...')\">\n Download Result\n </button>\n </div>\n `;\n } catch (error) {\n outputPreview.innerHTML = `\n <div class=\"error-message\">\n <p>Error processing images. Please try again.</p>\n </div>\n `;\n } finally {\n processBtn.disabled = false;\n processBtn.textContent = 'Process Images';\n }\n });\n});\n\n---end---\n\nThis implementation creates a beautiful, responsive webapp for MRI image enhancement with the following features:\n\n1. Clean, modern design with smooth animations and transitions\n2. Responsive layout that works on all devices\n3. File upload interface for T1w and T2w images\n4. Model selection dropdown (with future options disabled)\n5. Processing simulation with loading states\n6. Preview areas for uploaded files\n7. Results display section\n8. Accessible form controls and ARIA labels\n9. Error handling and user feedback\n10. Professional color scheme and typography\n\nThe design follows a blue-based color scheme that's appropriate for medical/scientific applications while maintaining a modern, professional look. The CSS includes advanced features like CSS Grid, Flexbox, CSS Variables, and smooth transitions. The JavaScript handles file uploads, previews, and simulates processing with proper error handling and loading states." + } + ], + "stop_reason": "end_turn", + "stop_sequence": null, + "usage": { + "input_tokens": 379, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "output_tokens": 2804 + } +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..28f4ab5 --- /dev/null +++ b/readme.scroll @@ -0,0 +1,3 @@ +# mrienhance.scroll.pub + +website generated by Claude from prompt: I want to create a webapp demo for mr image quality enhancement for my pitchdeck. I want to be able to upload nii image and select what model to use. 
Specifically, right now it only has one available usage that is upload a good quality T1w image, and the T2w image (motion corrupted). And it outputs the motion corrected T2w image.

But in the future, it can synthesize T2w contrast just from T1w image, super resolution T1w image \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..32ad5bc --- /dev/null +++ b/script.js @@ -0,0 +1,63 @@ +document.addEventListener('DOMContentLoaded', function() { + const t1Input = document.getElementById('t1-input'); + const t2Input = document.getElementById('t2-input'); + const t1Preview = document.getElementById('t1-preview'); + const t2Preview = document.getElementById('t2-preview'); + const processBtn = document.getElementById('process-btn'); + const outputPreview = document.getElementById('output-preview'); + + function updatePreview(file, previewElement) { + if (file) { + previewElement.innerHTML = ` + <div class="file-info"> + <p><strong>File:</strong> ${file.name}</p> + <p><strong>Size:</strong> ${(file.size / 1024 / 1024).toFixed(2)} MB</p> + </div> + `; + } else { + previewElement.innerHTML = '<p>No file selected</p>'; + } + } + + t1Input.addEventListener('change', (e) => { + updatePreview(e.target.files[0], t1Preview); + }); + + t2Input.addEventListener('change', (e) => { + updatePreview(e.target.files[0], t2Preview); + }); + + processBtn.addEventListener('click', async () => { + if (!t1Input.files[0] || !t2Input.files[0]) { + alert('Please upload both T1 and T2 images'); + return; + } + + processBtn.disabled = true; + processBtn.textContent = 'Processing...'; + + try { + // Simulate processing delay + await new Promise(resolve => setTimeout(resolve, 2000)); + + outputPreview.innerHTML = ` + <div class="success-message"> + <h4>Processing Complete!</h4> + <p>Enhanced T2w image generated successfully.</p> + <button class="process-button" onclick="alert('Download starting...')"> + Download Result + </button> + </div> + `; + } catch (error) { + outputPreview.innerHTML = ` + <div class="error-message"> + <p>Error processing images. Please try again.</p> + </div> + `; + } finally { + processBtn.disabled = false; + processBtn.textContent = 'Process Images'; + } + }); +}); diff --git a/style.css b/style.css new file mode 100644 index 0000000..82a6a97 --- /dev/null +++ b/style.css @@ -0,0 +1,180 @@ +:root { + --primary-color: #2a4365; + --secondary-color: #4299e1; + --background-color: #f7fafc; + --text-color: #2d3748; + --border-radius: 8px; + --transition: all 0.3s ease; +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: system-ui, -apple-system, sans-serif; + line-height: 1.6; + color: var(--text-color); + background: var(--background-color); +} + +header { + background: var(--primary-color); + padding: 1rem; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); +} + +nav { + max-width: 1200px; + margin: 0 auto; + display: flex; + justify-content: space-between; + align-items: center; +} + +.logo { + color: white; + font-size: 1.5rem; + font-weight: bold; +} + +.nav-links a { + color: white; + text-decoration: none; + margin-left: 2rem; + transition: var(--transition); +} + +.nav-links a:hover { + color: var(--secondary-color); +} + +.hero { + text-align: center; + padding: 4rem 2rem; + background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); + color: white; +} + +.hero h1 { + font-size: 2.5rem; + margin-bottom: 1rem; +} + +.upload-section { + max-width: 1200px; + margin: 2rem auto; + padding: 2rem; +} + +.upload-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 2rem; + margin: 2rem 0; +} + +.upload-box { + background: white; + padding: 2rem; + border-radius: var(--border-radius); + box-shadow: 0 4px 6px rgba(0,0,0,0.1); + transition: var(--transition); +} + +.upload-box:hover { + transform: translateY(-2px); + box-shadow: 0 6px 8px rgba(0,0,0,0.15); +} + +.upload-box label { + display: block; + margin-bottom: 1rem; + font-weight: bold; +} + +.upload-box input[type="file"] { + width: 100%; + padding: 0.5rem; + border: 2px dashed var(--secondary-color); + border-radius: var(--border-radius); + cursor: pointer; +} + +.preview { + margin-top: 1rem; + min-height: 200px; + background: var(--background-color); + border-radius: var(--border-radius); + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} + +.model-selection { + margin: 2rem 0; +} + +select { + width: 100%; + padding: 0.8rem; + border-radius: var(--border-radius); + border: 1px solid var(--secondary-color); + background: white; + margin-top: 1rem; +} + +.process-button { + display: block; + width: 100%; + padding: 1rem; + background: var(--secondary-color); + color: white; + border: none; + border-radius: var(--border-radius); + font-size: 1.1rem; + cursor: pointer; + transition: var(--transition); +} + +.process-button:hover { + background: var(--primary-color); + transform: translateY(-1px); +} + +.results-container { + margin-top: 2rem; + padding: 2rem; + background: white; + border-radius: var(--border-radius); + box-shadow: 0 4px 6px rgba(0,0,0,0.1); +} + +footer { + background: var(--primary-color); + color: white; + text-align: center; + padding: 1rem; + margin-top: 2rem; +} + +@media (max-width: 768px) { + .nav-links { + display: none; + } + + .hero h1 { + font-size: 2rem; + } + + .upload-section { + padding: 1rem; + } + + .upload-container { + grid-template-columns: 1fr; + } +}