# modify

## Overview

The tool modifies the contents of existing squirrel packages.

## Example Usage

List available variables for the pipeline object

```
bash> squirrel modify --variablelist study

Variable      Type       Required   Description                                                                                                   
AgeAtStudy    number     *          Subject's age in years at the time of the study                                                               
Datetime      datetime   *          Date of the study                                                                                             
DayNumber     number                For repeated studies and clinical trials, this indicates the day number of this study in relation to time 0   
Description   string     *          Study description                                                                                             
Equipment     string                Equipment name, on which the imaging session was collected                                                    
Height        number                Height in m of the subject at the time of the study                                                           
Modality      string     *          Defines the type of data. See table of supported modalities                                                   
Notes         string                Any notes about the study                                                                                     
StudyNumber   number     *          Study number. May be sequential or correspond to NiDB assigned study number                                   
StudyUID      string                DICOM field StudyUID                                                                                          
TimePoint     number                Similar to day number, but this should be an ordinal number                                                   
VisitType     string                Type of visit. ex: Pre, Post                                                                                  
Weight        number                Weight in kg of the subject at the time of the study 
```

Modify an existing subject to update the data of birth, sex, and gender

```
squirrel modify --operation update --object subject --objectdata 'SubjectID=S1234&DateOfBirth=1999-12-31&Sex=M&Gender=M'
```

## Options

### --operation

`--operation <operation>` can be one of the following

<table data-full-width="true"><thead><tr><th width="158.142822265625">Operation</th><th>Description</th><th>Associated options</th></tr></thead><tbody><tr><td>add</td><td>Add objects to the package</td><td>--object<br>--objectid<br>--subjectid<br>--studynum<br>--datapath<br>--objectdata</td></tr><tr><td>remove</td><td>Remove objects from the package</td><td>--object<br>--objectid<br>--subjectid<br>--studynum</td></tr><tr><td>update</td><td>Update existing objects within the package</td><td><p>--datapath</p><p>--object<br>--objectid<br>--objectdata</p></td></tr><tr><td>splitbymodality</td><td>Split the package by modality, into new packages for each of the existing modalities.</td><td></td></tr><tr><td>removephi</td><td>Remove PHI</td><td></td></tr></tbody></table>

### --object

`--object <object>` can be one of the following

* package
* subject
* study
* series
* analysis
* intervention
* observation
* experiment
* pipeline
* groupanalysis
* datadictionary

### --datapath

`--datapath <path>` is the path to the new object data. Path can contain a wildcard such as `/path/to/data/*.dcm`.&#x20;

### --objectid

`--objectid <id>` is the ID or name of an existing object in a package.

### --subjectid

`--subjectid <id>` is the ID of a subject. This option specifies the parent subject when working on **study**, **series**, **analysis**, **intervention**, and **observation** objects.

### --studynum

`--studynum <num>` is the study number. This option is used in combination with `--subjectid`, and specifies the parent study when working on **series** and **analysis** objects.

### --objectdata

`--objectdata <data>` is a URL-style string which specifies the new object meta-data.

### --variablelist

`--variablelist <object>` displays the possible meta-data variables available for the specified object.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.neuroinfodb.org/squirrel/getting-started/squirrel-utilities/modify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
