Sunday, December 11, 2022

Chat GPT - data storage in DNA

 data storage in DNA

Data can be stored in DNA by encoding the data as a sequence of nucleotides and synthesizing the DNA molecules that represent the encoded data. DNA is a highly stable and dense storage medium, and is capable of storing large amounts of data in a small space.

To store data in DNA, you would need to use a specific encoding scheme or algorithm to convert the data into a sequence of nucleotides. This sequence can then be synthesized as a strand of DNA using techniques such as PCR (polymerase chain reaction) or DNA synthesis.

Once the DNA molecules have been synthesized, they can be stored in a similar manner to other biological samples, such as in a cryogenic storage facility or a laboratory freezer. To retrieve the data, the DNA molecules would need to be amplified using PCR and then sequenced using techniques such as Sanger sequencing or next-generation sequencing.

In summary, data can be stored in DNA by encoding the data as a sequence of nucleotides and synthesizing the corresponding DNA molecules. This allows for the storage of large amounts of data in a small space, but requires specialized technology and expertise to encode, synthesize, and retrieve the data.

Larry Billinghurst
explain the steps

To store data in DNA, you would need to follow these general steps:

  1. Choose an encoding scheme or algorithm that can convert the data into a sequence of nucleotides. This will typically involve mapping the data bits to specific nucleotide bases, such as A, C, T, or G.

  2. Encode the data using the chosen encoding scheme or algorithm. This will generate a sequence of nucleotides that represents the data.

  3. Synthesize the DNA molecules that represent the encoded data. This can be done using techniques such as PCR (polymerase chain reaction) or DNA synthesis.

  4. Store the synthesized DNA molecules in a suitable storage medium. This could be a cryogenic storage facility or a laboratory freezer.

  5. To retrieve the data, amplify the DNA molecules using PCR and then sequence them using techniques such as Sanger sequencing or next-generation sequencing.

In summary, storing data in DNA involves encoding the data as a sequence of nucleotides, synthesizing the corresponding DNA molecules, and then storing and retrieving the molecules as needed. This process requires specialized technology and expertise, and is not suitable for all types of data or applications.

ChatGPT - Have we reached singularity yet?

On the 11th of December in 2022 I asked ChatGPT if we have we reached singularity yet?

Answer:

No, we have not reached the technological singularity yet. The singularity is a hypothetical future event in which artificial intelligence (AI) will surpass human intelligence and trigger a rapid acceleration of technological growth. This event is sometimes referred to as the "singularity" because it is difficult to predict what will happen after it occurs and how it will affect the world.

Currently, we are not close to achieving the level of artificial intelligence required for the singularity to occur. While AI technology has made significant progress in recent years, it is still not at the level where it can surpass human intelligence. In addition, there are still many technical, ethical, and philosophical challenges that must be overcome before the singularity can occur.

It is difficult to predict exactly when the singularity will occur, if it ever does. Some experts believe it may happen within the next few decades, while others believe it may not happen for centuries or even millennia. Ultimately, the singularity is a highly speculative and controversial topic, and it remains to be seen whether it will ever occur.

Chat GPT - How can we contact other life on other planets?

 How can we contact other life on other planets?

There are currently no known ways to directly contact or communicate with other life forms on other planets. While the possibility of extraterrestrial life exists, it is currently unknown whether such life exists and, if it does, whether it is technologically advanced enough to establish communication with us.

In the past, scientists have used radio telescopes to search for signs of intelligent life in the universe. This approach involves scanning the skies for radio signals that may be coming from other intelligent civilizations. However, this method has not yet yielded any definitive results and is considered to be a long shot at best.

In the future, if and when we do discover other intelligent life forms, we may be able to establish communication with them through the use of advanced technologies, such as advanced radio telescopes or other forms of long-distance communication. However, the challenges involved in such an endeavor would be immense, and it is currently unclear how we would go about establishing such communication.

Saturday, October 1, 2022

Index DICOM files with Python to csv

#!/usr/bin/env python

# This script will read DICOM Files and output headers to csv

import os
import sys
import os.path
import csv
import pydicom   # Load dicom tools.  Install with: pip install pydicom
import time
timestr = time.strftime("%Y%m%d-%H%M%S")
global success_count
global total_file_count
# files extensions not to index
file__ex_list = ['.xml','.gz','.zip','.txt','.doc','csv']
# set output file name
csvfilename = 'c:\\support\\DicomFileList-' + timestr + '.csv'
success_count = 0
total_file_count = 0
skipped_file_count = 0
# Set the path to scan for files
tpath = 'E:\\PACS-EXPORT' # \\20200130\\1.2.840.113619.2.226.6067236.1580392212.0.5\\1.2.840.113619.2.226.6067236.1580392212.0.6'
# create the header for the CSV file
csvheader = "SOPInstanceUID,StudyInstanceUID,AccessionNumber,PatientID,SeriesDescription,StudyDate,PatientName,Modality"
csvfile = open(csvfilename,'w', newline='')

#print(tpath)
# Recursively upload a directory

with csvfile:
    fnames = ['SOPInstanceUID','StudyInstanceUID','AccessionNumber','PatientID','SeriesDescription','StudyDate','PatientName','Modality','PatientBirthDate',"FileName"]
    csvwriter = csv.DictWriter(csvfile, fieldnames=fnames)
    csvwriter.writeheader()

    for root, dirs, files in os.walk(tpath):
        for f in files:
                total_file_count += 1
                #print(tpath)
                myfile = os.path.join(root,f)
                print("Looking at file -",myfile)
                #print(myfile.lower().endswith())
                if f.lower().endswith(tuple(file__ex_list)):
                    sys.stdout.write(" => skipping " + os.path.splitext(f)[1] + " file\n")
                    skipped_file_count += 1
                else:
                    success_count += 1
                    dicomdata = pydicom.dcmread(myfile)
                    csvwriter.writerow({
                                        'SOPInstanceUID' :  getattr(dicomdata,'SOPInstanceUID',''),
                                        'StudyInstanceUID' : getattr(dicomdata,'StudyInstanceUID',''),
                                        'AccessionNumber' : getattr(dicomdata,'AccessionNumber',''),
                                        'PatientID' : getattr(dicomdata,'PatientID',''),
                                        'SeriesDescription' : getattr(dicomdata,'SeriesDescription',''),
                                        'StudyDate' : getattr(dicomdata,'StudyDate',''),
                                        'PatientName' : getattr(dicomdata,'PatientName',''),
                                        'Modality' : getattr(dicomdata,'Modality',''),
                                        'PatientBirthDate' : getattr(dicomdata,'PatientBirthDate',''),
                                        "FileName" : myfile
                                        }) #patientName


if success_count == total_file_count:
    print("\nSummary: all %d DICOM file(s) have been processed successfully" % success_count)
else:
    print("\nSummary: %d out of %d files have been processed successfully as DICOM, with %d files skipped" % (success_count, total_file_count, skipped_file_count))

Friday, September 30, 2022

Count records in csv file and group duplicates in PowerShell

#
#  Output number of images per study form input file list
#   used to validate data in PACS Export and Transfer in October 2022
#   Why:  Needed to process a 400K item list of images files and group by study accession number with total of images see dicom files with python.


$dicomimages = Import-Csv  -Delimiter "," -Path .\DicomFilelist-20220928-135709.csv

$studylistcount = $dicomimages |Group-Object -Property AccessionNumber

[System.Collections.ArrayList]$dicomtruth = @{}



$studylistcount |ForEach-Object {

    $studygrp=$_.Group



     $count= $_.count

     $acc = $_.name

     $mrn = $studygrp| Select-Object -ExpandProperty PatientID -First 1

     $description =  $studygrp| Select-Object -ExpandProperty SeriesDescription -First 1

     $StudyDate =  $studygrp| Select-Object -ExpandProperty StudyDate -First 1

     $StudyInstanceUID  =  $studygrp| Select-Object -ExpandProperty StudyInstanceUID -First 1

     

    $line = [pscustomobject]@{  

            StudyUID = $StudyInstanceUID

            PatientMRN = $mrn

            AccessionNumber = $acc

            StudyDate = $StudyDate

            StudyDescription = $description

            NumberofImages = $count

            }

        $dicomtruth.add($line)|Out-Null    

        }

     $truthfile = "c:\support\dicomtruth-" + $(get-date -f yyyyMMddhhmm) + ".csv"

     $truthfile

     $dicomtruth |Export-Csv -Path $truthfile

Wednesday, July 13, 2022

Domain Setup 101

1.      Find a domain.

a.       https://instantdomainsearch.com/

2.      Purchase the domain

a.       Use GoDaddy or other domain sellers

3.      Purchase email

a.       Purchase email with the domain if needed

4.      Connect domain to your funnel or website

a.       Add domain

b.      Copy the IP to your DNS record

c.       Add www also if this is a top-level domain

d.      Connect your domain to site or funnel

5.      Test

a.       Connect to your domain site or funnel

b.      Try on multiple devices if possible


Thursday, June 30, 2022

Setup DICOM dcmtk Tool kit

How to setup the "dcmtk" DICOM tool

The DICOM Toolkit (DCMTK) can be installed on many platforms. It is a set of command line tools for use with the DICOM and PACS systems.  The extension for DICOM "when used" files is .dcm

DICOM standard ("Digital Imaging and Communications in Medicine"), which was first published in 1993, has become widely accepted.

The beginnings of the standard

Since the 1970s, when computed tomography was introduced as the first digital modality, the importance of digital medical image processing has increased permanently. The emerging idea of a digital image archive (PACS) and electronic image distribution in a hospital created the need to exchange digital images between medical devices of different manufacturers. 

    Ref: https://dcmtk.org/dcmintro.php.en

1. Install Chocolatey

Reference:
https://chocolatey.org/install


Run PowerShell as administrator.



Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Windows -> run -> cmd

close command prompt window and open new command prompt admin console

1. Install dcmtk

Reference:
        https://dcmtk.org/

then run

choco install dcmtk